Sql Server常用语句

--truncate table通过释放用于存储表数据的数据页来删除数据,并且在事务日志中只记录页释放这个动作,而不记录每一行
--TRUNCATE TABLE dbo.Student


--delete语句每次删除一行,并在事务日志中为所删除的每行记录一个项
--DELETE FROM dbo.Student


--alter table 表名 [add constraint 约束名] primary key(字段名1 ,… )

--添加约束
--alter table Student add constraint pk_Student_1 primary key(SNo)


--删除约束
--ALTER TABLE Student DROP CONSTRAINT pk_Student_1

猜你喜欢

转载自www.cnblogs.com/guxingy/p/9957748.html