SQL建表命令
//SQL中新建的数据库文件默认存放路径为:C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data//创建数据库use mastergoif exists (select * from sysdatabases where name='aaaaa' )drop database aaaaacreate database aaaaaon primary(name='aaaaa', fileName="f:\blog\aaaaa.mdf")go//创建表if exists(select * from sysobjects where name='bbbbb')drop table bbbbbcreate table bbbbb(id int primary key identity(1,1),name varchar(5) )//为aa表某字段添加外键alter table aa add constraint FK_bb foreign key (aid) references bb (bid)