建表啥的只点点鼠标,太外行了,不如来看看我的纯手写,让表从无到有一系列;还有存储过程临时表,不间断的重排序;

一:建数据库

1create Database Show

2 on 

 3  primary
 4 (
 5     name= Show_data ,
 6     filename= 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\Show.mdf' ,
 7     size=10MB,
 8     maxsize=UNLIMITED,
 9     filegrowth=10%
10      
11 )
12 log on
13 (
14   name=Show_log,
15   filename='C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\Show_log .ldf' ,
16     size=10MB,
17     maxsize=UNLIMITED,
18     filegrowth=10%
19 )

二:建表

建表

三:建外键

建外键

四:添加表数据

插入表数据

五:删除数据库、表、外键、存储过程

 1 drop database Show;      --删除数据库
 2 
 3 drop table T_user;      
 4 drop table T_proMain;
 5 drop table T_proType;
 6 drop table T_proImg;       --删除表
 7 
 8 alter table T_proMain drop constraint fk_typeID 
 9 alter table T_proMain drop constraint fk_UID 
10 alter table T_proImg drop constraint fk_proID   --删除外键约束
11 
12 drop  proc proc_getPic   --删除存储过程
删除数据库、表、外键、存储过程

相关文章:

  • 2021-04-30
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案