SQL Server 2008用T-sql 创建数据库及文件组,出现问题,怎样解决?
问题1. “filegroup附近有语法错误”,
问题2.“name附近有语法错误,应为‘SELECT'或‘)’
你缺少了filegroup 以及名称
filegroup前面少了个逗号,例子可以看这个
USE master GO IF DB_ID('Sample_DB') IS NOT NULL DROP DATABASE [Sample_DB] CREATE DATABASE [Sample_DB] ON PRIMARY( NAME =N'Sample_DB',FILENAME=N'C:\SQLData\Sample_DB.mdf', SIZE=3072KB,FILEGROWTH=1024KB ), FILEGROUP [FG_1] ( NAME =N'FG_1_DataFile',FILENAME=N'C:\SQLData\FG_1_DataFile.ndf', SIZE=3072KB,FILEGROWTH=1024KB ), FILEGROUP [FG_2] ( NAME =N'FG_2_DataFile',FILENAME=N'C:\SQLData\FG_2_DataFile.ndf', SIZE=3072KB,FILEGROWTH=1024KB ), FILEGROUP [FG_3] ( NAME =N'FG_3_DataFile',FILENAME=N'C:\SQLData\FG_3_DataFile.ndf', SIZE=3072KB,FILEGROWTH=1024KB ), FILEGROUP [FG_N] ( NAME =N'FG_N_DataFile',FILENAME=N'C:\SQLData\FG_N_DataFile.ndf', SIZE=3072KB,FILEGROWTH=1024KB ) LOG ON ( NAME =N'Sample_DB_log',FILENAME=N'C:\SQLData\Sample_DB_log.ldf', SIZE=3072KB,FILEGROWTH=10% ) GO