我的.ddf和我的database.i的.ldf文件已经尝试将其附加到我的sql server 2008中。
我写了这样的查询:CREATE DATABASE HRMS
ON ( FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MHI\MSSQL\DATA\HRMS.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON ( FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MHI\MSSQL\DATA\HRMS.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
但我收到错误:
消息1036,级别16,状态2,第1行 此CREATE / ALTER DATABASE语句中需要文件选项NAME。 Msg 1036,Level 16,State 2,Line 1 此CREATE / ALTER DATABASE语句中需要文件选项NAME。
现在我也尝试了这个..
Create database dbname
On
(
Filename= 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MHI\MSSQL\DATA\HRMS.mdf',
Filename = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MHI\MSSQL\DATA\HRMS.ldf'
)
For attach;
CREATE / ALTER DATABASE语句中选项Filename的使用无效。
答案 0 :(得分:0)
CREATE DATABASE HRMS
ON (NAME = 'HRMS', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MHI\MSSQL\DATA\HRMS.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON (NAME = 'HRMS_log', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MHI\MSSQL\DATA\HRMS.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
在您的对帐单中加入NAME
,如错误消息所示。
答案 1 :(得分:0)
你应该在你的陈述中加入NAME