Sql 表变量

declare @t table(CountryRegionCode nvarchar(3))
insert into @t(CountryRegionCode) (select CountryRegionCode from person.CountryRegion where Name like "C%")

 

select * from person.StateProvince where CountryRegionCode
in (select * from @t)

 

update test set test.name= ta.name  

from @mytabe as ta  

where test.id=ta.id  

str函数用法:

ltrim(str(@role))

posted @ 2012-08-28 11:43  tinaleft  阅读(135)  评论(0编辑  收藏  举报