Declare @i as intselect @i=ID from 表名print @i
Declare @i as intselect @i=列名 from 表名 where 主键=值print @i