-
@@Identity Output
I want to output the @@Identity value from a stored procedure which inserts some values into a table. The procedure is below, but I can't get it to work ????
Thanks in Advance
--Declare @Test int
--Exec spIdentityTest @Test output
CREATE PROCEDURE dbo.spIdentityTest
@intID int output
AS
Begin
INSERT INTO tblTest (myDescription1, myDescription2, myDescription3, myDescription4)
VALUES ('Text1', 'Text2', 'Text3', 'Text3')
RETURN --@@Identity
set @intID = @@Identity
print @intID
END
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|