Getting Null value Of variable in sql server

Posted by Neo on Stack Overflow See other posts from Stack Overflow or by Neo
Published on 2010-04-27T11:15:25Z Indexed on 2010/04/27 11:33 UTC
Read the original article Hit count: 280

Filed under:
|

Strange situation In a trigger i assign a column value to variable but gives exception while inserting into other table using that variable.

e.g

select @srNO=A.SrNo from A where id=123;
insert into B (SRNO) values (@srNo) // here it gives null


I run above select query in query pane it works fine but in trigger it gives me null

any suggestions

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-server-2005