建立資料庫
由於我們在建立資料庫時通常會使用圖形介面的方式來建立比較直覺方便
所以使用指令碼的方式可以當作參考
USE [master] GO /****** Object: Database [myDB] Script Date: 2016/4/19 上午 10:49:56 ******/ CREATE DATABASE [myDB] CONTAINMENT = NONE ON PRIMARY ( NAME = N'P1', FILENAME = N'C:\DB\P1.mdf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), ( NAME = N'P2', FILENAME = N'C:\DB\P2.ndf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), FILEGROUP [G1] ( NAME = N'G11', FILENAME = N'C:\DB\G11.ndf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), ( NAME = N'G12', FILENAME = N'C:\DB\G12.ndf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), FILEGROUP [G2] ( NAME = N'G21', FILENAME = N'C:\DB\G21.ndf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), ( NAME = N'G22', FILENAME = N'C:\DB\G22.ndf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'P1_log', FILENAME = N'C:\DB\P1_log.ldf' , SIZE = 2048KB , MAXSIZE = 2048GB , FILEGROWTH = 10%), ( NAME = N'P2_log', FILENAME = N'C:\DB\P2_log.ldf' , SIZE = 2048KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) GO
參考資料: