标量变量
如:@var1 int = null
表变量的声明
DECLARE @My_Table (id int)
用法
插入表A数据返回ID,一般有两种方法 @@ identity 或者inserted.id
把这个ID放入表变量@My_Table
insert into A (Name,Gender) output inserted.id into @My_Table values ('Name','时男时女')
    
      declare @My_id int
    
    
    
          set @My_id= (select id from @My_Table)
    
  


 
					 
					