SQL创建数据库的错误
发布网友
发布时间:2022-04-10 17:52
我来回答
共1个回答
热心网友
时间:2022-04-10 19:22
--首先size前需要个逗号
--其次是 FILEGROWTH,不是 filegrowt
USE master
GO
if EXISTS(
SELECT name FROM sys.databases where name ='database_demo1')
DROP database database_demo1
go
create database database_demo1
on
PRIMARY
(name=darabse_demo1data,
FILENAME='c:\program files\Microsoft SQL Server\MSSQL10_50.MSSQL2008\MSSQL\DATA\database_demo1Data.mdf'
,SIZE = 10 ,maxsize=50,FILEGROWTH=5),
(name=darabse_demo1data2,
FILENAME='c:\program files\Microsoft SQL Server\MSSQL10_50.MSSQL2008\MSSQL\DATA\database_demo1Data2.ndf'
,size=17mb,maxsize=100,FILEGROWTH=2)
LOG ON
(name=darabse_demo1log,
FILENAME='c:\program files\Microsoft SQL Server\MSSQL10_50.MSSQL2008\MSSQL\DATA\database_demo1log.ldf'
,size=5mb,maxsize=25mb,FILEGROWTH=5mb),
(name=darabse_demo1log2,
FILENAME='c:\program files\Microsoft SQL Server\MSSQL10_50.MSSQL2008\MSSQL\DATA\database_demo1log2.ldf'
,size=20mb,maxsize=100,FILEGROWTH=1)