随笔分类 - SqlServer
摘要:1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断<!--more--> select * from people where peopleId in (select peopleId from people group by peopleId having count(p
阅读全文
摘要:DECLARE My_Cursor CURSOR --定义游标 declare@indexId int FOR (SELECT * FROM dbo.GalleryPhoto) --查出需要的集合放到游标中 OPEN My_Cursor; --打开游标 FETCH NEXT FROM My_Curs
阅读全文
摘要:ALTER Trigger [dbo].[test] --新建触发器 On [dbo].[test1] --在test1表中创建触发器 for insert --触发条件 As --事件触发后所要做的事情 declare @id int, @test varchar(20); --定义变量 sele
阅读全文