Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scope_identity insert problem 2

Status
Not open for further replies.

slatet

Programmer
Sep 11, 2003
116
US
We're having some difficulty with a scope_identity var that gets returned from an insert. When printed, it is correct, but when we try to use it for another insert, nothing is ever inserted into the table.

Here is the first insert:
Insert into Master_Node (a bunch of cols)
Values (a bunch of vars)
SELECT SCOPE_IDENTITY() AS @pINodeID


print @pINodeID - this prints out the correct values

insert into Links (Link_Name, Parent_INode_ID) Values (@Links, @pINodeID) - when this inserts, the "Parent_INode_ID" value is ,null>

anyone know why? This is our last bug to completing the procedure.

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top