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'.
第一天学习,请各位帮忙解决谢谢。

解决方案 »

  1.   

    简单的我来~~~
    =======================
    6、use 销售数据库
    create table 客户表
    (
    客户编号 int
    联系人 char(10)
    送货地点 varchar(50)
    )
      

  2.   

    1、
    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.   

    2、你要干什么?
    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)
    )
      

  4.   

    6、use 销售数据库
    creat table 客户表                                  --create
    (
    客户编号 int,                                       --逗号
    联系人 char(10),                                    --逗号
    送货地点 varchar(50)
    )
      

  5.   

    楼上的:
    name=航空数据库_dat,为什么要这样写?
      

  6.   

    另:
    .LDF与.MDF和.NDF分别是代表什么文件?
      

  7.   

    问题1:
        NAME项后,未加分隔符,
        FileName中须指定为实际路径改为:
    ------------------------------------------------------------
    create database 航空数据库
    on (
    name=航空数据库,
    filename = 'D:\mssql7\data\航空数据库.MDF',
    size=10MB,
    maxsize=50MB,
    filegrowth=5)
      

  8.   

    MDF:主数据文件,主文件包含数据库的启动信息。主文件还可以用来存储数据。每个数据库都包含一个主文件。NDF:次要数据文件,一个数据库可以指定一个或多个次要数据文件,也可以不指定。LDF:事务日志文件,保存数据库的日志信息,一个数据库至少有一个日志文件。每个数据库至少有两个文件,一个主文件和一个事务日志文件。详细信息可以参考联机帮助里的Create Database(索引里)
      

  9.   

    to yizhinet:
    sorry,我第一天学。
    不知道这个人。
      

  10.   

    哦,你是在学 NIIT课程 吧?