SQL 语句

--批量删除 @id是多个id逗号分割

elete from Adsense where charindex(ltrim(Id)+',',@id,0) > 0

EntityFramework

--查询xml字段数据

比如:advert 表region字段

<root>  <item name="安徽">634341883997031250</item>  <item name="福建">634341884004531250</item>  <item name="青海">634341884039062500</item>  <item name="台湾">634341884051250000</item></root>

select * from advert where region.exist('/root/item[@name="福建"]')=1

declare @a bigint
set @a = 634341884004531250

select * from advert where region.exist('/root/item[.=sql:variable("@a")]')=1

posted @ 2011-03-10 16:23  单单的忧伤  Views(105)  Comments(0)    收藏  举报