当前位置:Gxlcms > 数据库问题 > sql server 变量和select 赋值的联合使用demo

sql server 变量和select 赋值的联合使用demo

时间:2021-07-01 10:21:17 帮助过:3人阅读

@cltcode VARCHAR(30) DECLARE @brand VARCHAR(30) select @cltcode=cltcode,@brand=brand from prosamplehd CREATE table #t ( cltcode VARCHAR(30), brand VARCHAR(30) ) INSERT into #t (cltcode ,brand) VALUES (@cltcode ,@brand) select *from #t

 

 

 

 

解释:

DECLARE  定义变量后 

创建临时表,然后insert into 中插入变量的返回值, 

 

sql server 变量和select 赋值的联合使用demo

标签:value   dem   返回   span   tab   font   定义   size   sql   

人气教程排行