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 |
dirwin26
Yak Posting Veteran
81 Posts |
Posted - 2006-09-14 : 09:49:00
|
how do I test that several variables i am using match up with values in a table as a means Quality assurance. If the values do not match, then I want the SP to end itself. The code below is obv. incorrect, but it will give an idea as to what I am going for....CREATE PROCEDURE sp1 @1 VARCHAR(50), @2 FLOAT, @3 FLOAT ASIF @1 = colA and @2 = colBFROM tblWHERE @3 = colC BEGIN execute MY codeelsebegin terminate the SPENDGOAny help would be apperciated. |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-09-14 : 10:00:24
|
If exists(Select * from table where colA=@1 and colB=@2 and colC=@3)Execute the codeMadhivananFailing to plan is Planning to fail |
 |
|
dirwin26
Yak Posting Veteran
81 Posts |
Posted - 2006-09-15 : 08:44:55
|
thanks. |
 |
|
|
|
|