1、create database 航空数据库
on(
name=航空数据库
filename = 'D:\mssql7\data\航空数据库.LDF',
size=10MB,
maxsize=50MB,
filegrowth=5
)
错误提示:
Server: Msg 153, Level 15, State 1, Line 4
Invalid usage of the option filename in the CREATE/ALTER DATABASE statement.2、exec sp_detach_db master
exec sp_detach_db model
exec sp_detach_db tempdb
exec sp_detach_db 贸易数据库
错误提示:
Server: Msg 7940, Level 16, State 1, Line 1
System databases master, model, and tempdb cannot be detached.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Server: Msg 3702, Level 16, State 1, Line 1
Cannot drop the database '贸易数据库' because it is currently in use.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
3、create database northwind
on primary (filename='D:\mssql7\data\northwind.mdf')
for attach
错误提示:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name 'D:\mssql7\data\northwind.mdf' may be incorrect.
4. alter database 销售数据库
add file(
name=销售数据库1
filename='D:\销售数据库6.NDF',
size = 10MB
)
错误提示:
Server: Msg 153, Level 15, State 1, Line 4
Invalid usage of the option filename in the CREATE/ALTER DATABASE statement.
5、use database 销售数据库
drop database 销售数据库
错误提示:
Server: Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'database'.
6、use 销售数据库
creat table 客户表
(
客户编号 int
联系人 char(10)
送货地点 varchar(50)
)
错误提示:
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near 'creat'.
第一天学习,请各位帮忙解决谢谢。
on(
name=航空数据库
filename = 'D:\mssql7\data\航空数据库.LDF',
size=10MB,
maxsize=50MB,
filegrowth=5
)
错误提示:
Server: Msg 153, Level 15, State 1, Line 4
Invalid usage of the option filename in the CREATE/ALTER DATABASE statement.2、exec sp_detach_db master
exec sp_detach_db model
exec sp_detach_db tempdb
exec sp_detach_db 贸易数据库
错误提示:
Server: Msg 7940, Level 16, State 1, Line 1
System databases master, model, and tempdb cannot be detached.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Server: Msg 3702, Level 16, State 1, Line 1
Cannot drop the database '贸易数据库' because it is currently in use.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
3、create database northwind
on primary (filename='D:\mssql7\data\northwind.mdf')
for attach
错误提示:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name 'D:\mssql7\data\northwind.mdf' may be incorrect.
4. alter database 销售数据库
add file(
name=销售数据库1
filename='D:\销售数据库6.NDF',
size = 10MB
)
错误提示:
Server: Msg 153, Level 15, State 1, Line 4
Invalid usage of the option filename in the CREATE/ALTER DATABASE statement.
5、use database 销售数据库
drop database 销售数据库
错误提示:
Server: Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'database'.
6、use 销售数据库
creat table 客户表
(
客户编号 int
联系人 char(10)
送货地点 varchar(50)
)
错误提示:
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near 'creat'.
第一天学习,请各位帮忙解决谢谢。
=======================
6、use 销售数据库
create table 客户表
(
客户编号 int
联系人 char(10)
送货地点 varchar(50)
)
create database 航空数据库
on(
name=航空数据库_dat,
filename = 'D:\mssql7\data\航空数据库.MDF',
size=10,
maxsize=50,
filegrowth=5
)
LOG ON
( NAME = '航空数据库_log',
FILENAME = 'D:\mssql7\data\航空数据库.LDF',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )
3、检查是否存在D:\mssql7\data\northwind.mdf文件
4、 alter database 销售数据库
add file(
name=销售数据库1, --逗号
filename='D:\销售数据库6.NDF',
size = 10MB
)
5、use master
drop database 销售数据库6、use 销售数据库
creat table 客户表
(
客户编号 int, --逗号
联系人 char(10), --逗号
送货地点 varchar(50)
)
creat table 客户表 --create
(
客户编号 int, --逗号
联系人 char(10), --逗号
送货地点 varchar(50)
)
name=航空数据库_dat,为什么要这样写?
.LDF与.MDF和.NDF分别是代表什么文件?
NAME项后,未加分隔符,
FileName中须指定为实际路径改为:
------------------------------------------------------------
create database 航空数据库
on (
name=航空数据库,
filename = 'D:\mssql7\data\航空数据库.MDF',
size=10MB,
maxsize=50MB,
filegrowth=5)
sorry,我第一天学。
不知道这个人。