This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line! See this thread for details.
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