Return NEWSEQUENTIALID() as an output parameter
Use the Output clause of the Insert statement.
CREATE PROCEDURE [Insert_test] @name as varchar(50), @id as uniqueidentifier OUTPUTASBEGIN declare @returnid table (id uniqueidentifier) INSERT INTO test( name ) output inserted.id into @returnid VALUES( @name ) select @id = r.id from @returnid rENDGO/* Test the Procedure */declare @myid uniqueidentifierexec insert_test 'dummy', @myid outputselect @myid