1 --普通方法赋值 2 declare @a int 3 set @a = 115 4 print @a 5 6 --Update 方法赋值 7 declare @name varchar(50) 8 update userTable set @name = fname where fid = '001' 9 print @name 10 11 --Select 语句赋值 12 declare @name varchar(50) 13 select @name = fname from userTable where fid = '001' 14 print @name 15 16 declare @name varchar(50) 17 select @name = '张三' 18 print @name