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 |
|
babes_axa
Starting Member
4 Posts |
Posted - 2008-09-09 : 18:13:26
|
| Can someone help me please? Can I use a check constriant inside a trigger? I need to check the value of a column in one table before I insert into the second table?Thanks much,MJ |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-09-09 : 19:28:43
|
| check constraints don't work accross tables. If you simply want to check for the existance perhaps a Foriegn Key constraint is what you want. Otherwise you'll need to use t-sql. Either in a trigger or if the insert always happens via an SP then in the INSERT SP.Be One with the OptimizerTG |
 |
|
|
babes_axa
Starting Member
4 Posts |
Posted - 2008-09-10 : 05:47:07
|
| Thanks guys,Well, I suppose the question is answered as to whether the check would work across tables. What I'm trying to do is to check the maxValue in one table, if it is not reached then I am allowed to add another element but in another table.Ok, I will try this with a sp.Best,MJ |
 |
|
|
|
|
|