添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
奋斗的豆浆  ·  搭建 TypeScript 环境 & ...·  6 月前    · 
听话的板栗  ·  Configure Azure AD ...·  1 年前    · 
打篮球的啄木鸟  ·  can not be cast to ...·  1 年前    · 

测试数据:

create table test
(
value int not null
)

-----drop  table  test

insert into test (value)
select 2
union all
select 3
union all
select 2
union all
select 7
union all
select 6
union all
select 3
union all
select 5
union all
select 6
union all
select 8
union all
select 4
union all
select 9
union all
select 4
union all
select 1
union all
select 2

select  *  from  test

declare @cc int
declare @str varchar(8000)
set @cc=9999

print @cc
set @str='select value as '+'['+cast(@cc as varchar(10))+']'+'from test'
print @str

测试结果: