随笔分类 -  MSSQL

摘要:Create table LogInfo ( Id uniqueidentifier unique, content text null, Inputdate datetime not null, ) alter table LogInfo add constraint constraint_Id 阅读全文
posted @ 2019-01-11 10:56 码到世界末日 阅读(110) 评论(0) 推荐(0)
摘要:if(exists (select 1 from sys.objects where name='proc_out')) --用于判断改存储过程是否存在 drop proc proc_out GO CREATE PROC proc_out @id1 int out, --out 可以传进,可以传出 阅读全文
posted @ 2019-01-10 17:59 码到世界末日 阅读(139) 评论(0) 推荐(0)
摘要:MD5 :hashbytes('md5','*******') varbinary转varchar CONVERT(varchar(max),'********',2) pwdencrypt('*******') 比较 PWDCOMPARE('*********',pwdencrypt('***** 阅读全文
posted @ 2018-12-18 10:30 码到世界末日 阅读(186) 评论(0) 推荐(0)
摘要:1、修改字段名: alter table 表名 rename column A to B 2、修改字段类型: alter table 表名 alter column 字段名 type not null 3、修改字段默认值 alter table 表名 add default (0) for 字段名 阅读全文
posted @ 2018-09-10 15:13 码到世界末日 阅读(158) 评论(0) 推荐(0)
摘要:select ',' + ta.value from ta for xml path; select ','+ value from ta for xml path(''); select * from ta for xml path('row'); select * from ta for xml path(''); 阅读全文
posted @ 2018-07-17 11:05 码到世界末日 阅读(135) 评论(0) 推荐(0)
摘要:SQL Server中,如果目标表存在: SQL Server中,,如果目标表不存在: 阅读全文
posted @ 2018-05-08 15:15 码到世界末日 阅读(1516) 评论(0) 推荐(0)
摘要:DBCC CHECKIDENT(Vol_Students,RESEED,0) 阅读全文
posted @ 2018-04-09 11:03 码到世界末日 阅读(170) 评论(0) 推荐(0)
摘要:1、查看死锁表 阅读全文
posted @ 2017-09-05 11:05 码到世界末日 阅读(146) 评论(0) 推荐(0)