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.
| Author |
Topic |
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-04-16 : 07:22:45
|
My proc is something like thisCREATE PROC DeleteSchedule( @ID BIGINT @T_ID BIGINT @R_ID BIGINT)ASBEGIN DELETE FROM testtableWHERE ID = @ID AND T_ID = @T_ID AND R_ID = @R_IDEND IF @R_ID is not null THEN I want to execute delete command with checking R_IDAnd if its null then i dont want to check R_ID condition How can i do ??Please help me out...Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-16 : 07:28:16
|
"AND (@R_ID IS NULL OR R_ID = @R_ID)" instead of "AND R_ID = @R_ID" No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-04-16 : 07:42:01
|
| Yes It goes,Thank you very much webfred...I solved my problem.Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-16 : 07:44:55
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|