tags:

views:

28

answers:

1

I need to return newly created GUID from Stored procedure for each time i make a call.

How can i achieve this?

+1  A: 
CREATE PROCEDURE YourSproc
@guid UNIQUEIDENTIFIER OUTPUT
AS
SET @guid = NEWID()

And an example of calling it...

DECLARE @temp UNIQUEIDENTIFIER
EXEC YourSproc @temp OUTPUT
SELECT @temp
LukeH