摘要: 1、视图删除表 2、使用sql语句删除数据表 drop table <表名> if exists (select * from sysobjects where name='Commoditylnfo') drop table Commoditylnfo --删除后创建 create table C 阅读全文
posted @ 2020-03-27 11:18 Sugar_zxf 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1、对特定的数据库表进行可视化管理与分析 2、一个数据库可以创建多个数据库关系图 3、使用系统存储过程改变数据库所有者为当前登录账号 EXEC sp_changedbowner sa 阅读全文
posted @ 2020-03-27 11:16 Sugar_zxf 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1、视图删除约束 2、sql语句删除约束 alter table <表名> drop constraint <约束名> 阅读全文
posted @ 2020-03-27 11:14 Sugar_zxf 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 1、T-SQL语句添加约束(表中没有数据时): 语法:alter table <表名> add constraint <约束名> <约束类型> <具体的约束说明 > 约束名的取名规则推荐采用:约束类型_约束列 主键(Primary Key)约束:如:PK_UserId 唯一(Unique Key) 阅读全文
posted @ 2020-03-27 11:13 Sugar_zxf 阅读(843) 评论(0) 推荐(0) 编辑
摘要: 1、约束类型: 主键约束(PRIMARY KEY): 1、要求主键列不能为空 2、约束唯一标识数据库表中的每一条记录 3、主键必须包含唯一的值 4、每张表都应该有一个主键 5、语法: 1、创建主键(创建表时):create table <表名> (StudentID int not null pri 阅读全文
posted @ 2020-03-27 10:44 Sugar_zxf 阅读(275) 评论(0) 推荐(0) 编辑