消息 102,级别 15,状态 1,第 5 行 “,”附近有语法错误。是什么意思,请大佬指教
USEmaster;GOIFDB_ID('archive')ISNOTNULLDROPDATABASEarchive;GODECLARE@data_pathnvarcha...
USE master;
GO
IF DB_ID ('archive') IS NOT NULL
DROP DATABASE archive;
GO
DECLARE @data_path nvarchar(256);
SET @data_path=(
SELECT SUBSTRING(physical_name,1,CHARINDEX('master.mdf',LOWER(physical_name)) - 1)
FROM master.sys.master_files
WHERE database_id = 1 AND file_id = 1);
EXECUTE
('CREATE DATABASE archive
ON
PRIMARY
(NAME = arch1,
FILENAME = '''+ @data_path + 'archdat1.mdf'',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 1MB),
(NAME = arch2,
FILENAME = '''+ @data_path + 'archdat2.ndf'',
SIZE = 3MB,
MAXSIZE = 50MB,
FILEGROWTH = 1MB),
( NAME = arch3,
FILENAME = '''+ @data_path + 'archdat3.ndf'',
SIZE = 3MB,
MAXSIZE = 50MB,
FILEGROWTH = 1MB)
LOG ON
(NAME = archlog1,
FILENAME = '''+ @data_path + 'archlog1.ldf'',
SIZE = 2MB,
MAXSIZE = 10MB,
FILEGROWTH = 5%),
(NAME = archlog2,
FILENAME = '''+ @data_path + 'archlog2.ldf'',
SIZE = 2MB,
MAXSIZE = 10MB,
FILEGROWTH = 5%)'
);
GO 展开
GO
IF DB_ID ('archive') IS NOT NULL
DROP DATABASE archive;
GO
DECLARE @data_path nvarchar(256);
SET @data_path=(
SELECT SUBSTRING(physical_name,1,CHARINDEX('master.mdf',LOWER(physical_name)) - 1)
FROM master.sys.master_files
WHERE database_id = 1 AND file_id = 1);
EXECUTE
('CREATE DATABASE archive
ON
PRIMARY
(NAME = arch1,
FILENAME = '''+ @data_path + 'archdat1.mdf'',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 1MB),
(NAME = arch2,
FILENAME = '''+ @data_path + 'archdat2.ndf'',
SIZE = 3MB,
MAXSIZE = 50MB,
FILEGROWTH = 1MB),
( NAME = arch3,
FILENAME = '''+ @data_path + 'archdat3.ndf'',
SIZE = 3MB,
MAXSIZE = 50MB,
FILEGROWTH = 1MB)
LOG ON
(NAME = archlog1,
FILENAME = '''+ @data_path + 'archlog1.ldf'',
SIZE = 2MB,
MAXSIZE = 10MB,
FILEGROWTH = 5%),
(NAME = archlog2,
FILENAME = '''+ @data_path + 'archlog2.ldf'',
SIZE = 2MB,
MAXSIZE = 10MB,
FILEGROWTH = 5%)'
);
GO 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询