Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Stored Procedure.

Author  Topic 

danasegarane76
Posting Yak Master

242 Posts

Posted - 2006-09-07 : 01:57:12
Dear Team.
I want to create a stored procedure with the follwoing option.
If the input string is "stage1" then
It has to update some columns

If the input string is "stage2" then
It has to update some columns

If the input string is "stage3" then
It has to update some columns

How can I

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-09-07 : 02:05:51
[code]
Create proc yourproc
(
@InputString varchar(100)
)
As
Begin
If @InputString == 'stage1'
--- update some column
Else If @InputString == 'stage2'
--- update some column
Else If @InputString == 'stage3'
--- update some column

return
End
[/code]

Chirag
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-09-07 : 12:03:01
quote:
Originally posted by chiragkhabaria


Create proc yourproc
(
@InputString varchar(100)
)
As
Begin
If @InputString == 'stage1'
--- update some column
Else If @InputString == 'stage2'
--- update some column
Else If @InputString == 'stage3'
--- update some column

return
End


Chirag



You dont need double equals
Effect of Front end


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

OBINNA_EKE
Posting Yak Master

234 Posts

Posted - 2006-09-08 : 04:22:37
Are you happy with the answer ? danasegarane76

If it is that easy, everybody will be doing it
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-09-08 : 04:52:02
quote:
Originally posted by madhivanan

You dont need double equals
Effect of Front end


Madhivanan

Failing to plan is Planning to fail



You mean double equal operator, == right ?

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-09-09 : 01:51:55
quote:
Originally posted by harsh_athalye

quote:
Originally posted by madhivanan

You dont need double equals
Effect of Front end


Madhivanan

Failing to plan is Planning to fail



You mean double equal operator, == right ?

Harsh Athalye
India.
"Nothing is Impossible"



Yeah...

Thanks Madhi, Since now a days working more with the front end part so ...

Chirag
Go to Top of Page
   

- Advertisement -