Hi !!! I am wrting a small store Proc for inserting an value and fetching the Id for the value inserted.
i.e I have Id as an identity column (auto incremented) so i wanted to know the ID for which i am doing the insert operation.
My Store Proc goes like this
CREATE PROCEDURE dbo.spInsertStackTrace ( @StackTraceLog as varchar (4000), @StackTest as varchar (50), @StackTraceId as int output ) AS BEGIN Insert Into StackTrace(StackTraceLog,StackTest) Values(@StackTraceLog,@StackTest) Select @StackTraceId = MAX(StackTraceId) from StackTrace