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

📉 Study: African Women Face Higher Risk of Job Loss to AI in Outsourcing Sector

🎨 Is There a Future for Graphic Designers in the AI Era?