程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> SqlServer數據庫 >> 關於SqlServer >> 一個SQLServer2000實驗的具體說明

一個SQLServer2000實驗的具體說明

編輯:關於SqlServer
今天做SQL Server 2000的一個實驗,比較簡單的那種,新建數據庫,修改日志文件的大小等等吧,恩,應該還是比較簡單的了。下面還是記錄一下啦~都這麼就沒有來過了的。
  
  /*
  ** CREABASE.SQL
  **
  ** Drop and Rereate the credit database. Record the time required.
  */
  
  PRINT 'Begin CREABASE.SQL'
  GO
  
  USE master
  SET nocount ON
  GO
  
  IF db_id('credit') IS NOT NULL
  DROP DATABASE credit
  GO
  
  CREATE DATABASE [credit]
  ON PRIMARY (NAME = N'credit_Data',
  FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQLDatacredit_Data.MDF',
  SIZE = 50,
  FILEGROWTH = 10%)
  LOG ON (NAME = N'credit_Log',
  FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQLDatacredit_Log.LDF',
  SIZE = 1,
  FILEGROWTH = 10%)
  GO
  
  ALTER DATABASE credit
  ADD FILEGROUP CreditTablesFG
  GO
  ALTER DATABASE credit
  ADD FILEGROUP CreditIndexesFG
  GO
  ALTER DATABASE credit
  ADD FILE (
  NAME = CreditTables,
  FILENAME = 'C:Program FilesMicrosoft SQL ServerMSSQLDataCreditTables.ndf',
  SIZE = 8MB,
  MAXSIZE = UNLIMITED,
  FILEGROWTH = 50MB )
  TO FILEGROUP CreditTablesFG
  ALTER DATABASE credit
  ADD FILE (
  NAME = CreditIndexes,
  FILENAME = 'C:Program FilesMicrosoft SQL ServerMSSQLDataCreditIndexes.ndf',
  SIZE = 8MB,
  MAXSIZE = UNLIMITED,
  FILEGROWTH = 50MB )
  TO FILEGROUP CreditIndexesFG
  GO
  
  PRINT ' '
  IF db_id('credit') IS NOT NULL
  PRINT 'CREATED DATABASE "credit"'
  ELSE
  PRINT 'CREATE DATABASE "credit" FAILED'
  PRINT ' '
  GO
  
  /*
  ** This script sets the database recovery model to SIMPLE
  ** for the ClassNorthwind database. Simple Recovery allows
  ** the database to be recovered to the most recent backup.
  **
  ** Look under the status column of your sp_helpdb results to
  ** vIEw the recovery model that has been set for a database.
  */
  
  USE ClassNorthwind
  
  ALTER DATABASE ClassNorthwind SET RECOVERY SIMPLE
  
  EXEC sp_helpdb ClassNorthwind
  GO
  
  /*
  This script modi
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved