VB.NET - how to write stored procedure of this query

Asked By prasad vjp on 10-Feb-12 02:12 AM

how to write stored procedure of this query

"

Select ID, DestinationNo From Tbl_UserBlackList whereUser_ID={0}{1}

Web Star replied to prasad vjp on 10-Feb-12 02:16 AM
simply try this way

Create proc spname
(
@userid int
)
AS
Begin
Select ID, DestinationNo From Tbl_UserBlackList whereUser_ID=@userid 


End
Reena Jain replied to prasad vjp on 10-Feb-12 05:51 AM
Hi,

Use In clause if you want to check more then one option in where condition like this
Create proc spname
(
@userid int
)
AS
Begin

Select ID, DestinationNo From Tbl_UserBlackList where User_ID in (0,1)
or
Select ID, DestinationNo From Tbl_UserBlackList where User_ID in (@userid)

try this and let me know