CREATE PROCEDURE [test]
@name as varchar(50),
@id as uniqueidentifier OUTPUTAS
BEGIN
declare @returnid table (id uniqueidentifier)
INSERT INTO test(
name
)
output inserted.id into @returnid
VALUES(
@name
)
select @id = r.id from @returnid rEND
Above SP returns the newly inserted GUID as the OUT parameter.
No comments:
Post a Comment