Sqlserver 插入一条记录时,不重复插入的办法
时间:2011-01-27 来源:GDLMO
代码
insert into
[Catchpage].[dbo].[gdlmo_yq]([title],[PageUrl])
select 'aaaa','http://10.4.19.252'
where not exists
(select * from [Catchpage].[dbo].[gdlmo_yq] b where b.[PageUrl] = 'http://10.4.19.252')
[Catchpage].[dbo].[gdlmo_yq]([title],[PageUrl])
select 'aaaa','http://10.4.19.252'
where not exists
(select * from [Catchpage].[dbo].[gdlmo_yq] b where b.[PageUrl] = 'http://10.4.19.252')
相关阅读 更多 +