I wat to create stored procedure in sql server 2005.
1) i want to retirve data from table1 and assign to variable which would have declared in stored procdeure. Later i will be using this variable in stored procedure.
Create PROCEDURE [dbo].[sp1]
Declare @NewEventCode varchar(20)
//i want to retreive data rom table1( which will have only one record and one column ) and assign the value to @NewEventCode .
"select code1 to @NewEventCode from table1 "
Can you please help us on this.