declare @id int

declare @name char(10) ;注意:char(10)为10位,要是位数小了会让数据出错

set @id=1

select @id=1

select @id=(select  1)