Variable Declaration and If Condition in Sql Server Stored Procedure

Create Proc Usp_CheckStatus
@id int
As
Begin

Declare @status nvarchar(50)
Set @status=(select status from TblUsers where id=@id)

   If(@status='active')
   Begin

---Your Block of Code/query

  End

End

Comments

Popular posts from this blog

Uploading Image to Sql Server Image Datatype in asp.net using fileupload Control

Get Running Sum of Query SQL Query