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 |
|
SATHISH_KUMAR
Starting Member
1 Post |
Posted - 2003-07-08 : 07:24:42
|
| I am new to the stored proceduresI am passing some values to the stored procedure which is used to insert values to the databse, at the time of insertion it should check if the value exists if yes only it should insert the values otherwise it should redirect to an error page.How should i go about Can you help me in this stored procedureWhat you think is waht you are |
|
|
Amethystium
Aged Yak Warrior
701 Posts |
Posted - 2003-07-08 : 09:47:55
|
Use Triggers for this job.  |
 |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2003-07-08 : 10:08:59
|
I think you'd be better to use an IF NOT EXISTS statement. Something likeIF NOT EXISTS (Select * from MyTable Where PKVal = @Parm) INSERT ...ELSE RAISERROR ... I think triggers would just add unnecessary complexity.===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
|
|
|