22,210
社区成员
发帖
与我相关
我的任务
分享
if OBJECT_ID('tempdb..#temp') is not null drop table #temp
create table #temp
(
id10 int,
id16 varbinary
)
insert #temp(id10)
select 1 union all select 2 union all select 3 union all
select 4 union all select 5 union all select 6 union all
select 7 union all select 8 union all select 9 union all
select 10 union all select 11 union all select 12 union all
select 13 union all select 14 union all select 15 union all
select 16 union all select 17 union all select 18
go
--update:
update #temp
set id16 = id10+1
--sql:
SELECT max(CONVERT(varbinary, id10)), MAX(id16) from #temp
/*
(无列名) (无列名)
0x00000012 0x13
*/