I have a stored procedure:
ALTER PROCEDURE [dbo].[pr_Tbl_Test_Insert]
@guidid uniqueidentifier output,
@sname nvarchar(50)
AS
-- INSERT a new row in
Why are you setting the @guidid uniqueidentifier output as an output parameter? It means it will override it once you execute the stored procedure. If that's your intention, then you need to add a statement after the insert statement to set the output parameter to the value you want. something like this: select @guidid = @generatedID. Yeah look at marc_s code, that's the way you are supposed to do it.