| Computers Forum Index » Computer - Databases - MS SQL Server » relationship with const values... |
|
Page 1 of 1 |
|
| Author |
Message |
| ArekK... |
Posted: Fri Oct 30, 2009 7:32 pm |
|
|
|
Guest
|
Hi
I have 3 tables In DB.
Def (ObjectIdx PK, ObjectN, ObjectType)
Conf1 (CylinderId PK, Name, ...)
Conf2 (EngineId PK, Name, ...)
Is anyone know how to make relationship with rule below.
Def.ObjectN =Conf1.CylinderId and Def.ObjectType =1
Def.ObjectN =Conf2.EngineId and Def.ObjectType =2 |
|
|
| Back to top |
|
|
|
| ArekK... |
Posted: Fri Oct 30, 2009 7:36 pm |
|
|
|
Guest
|
Użytkownik "ArekK" <akrawczyk at (no spam) unico.com.pl> napisał w wiadomości
news:hcf13b$549$1 at (no spam) atlantis.news.neostrada.pl...
Quote: Hi
I have 3 tables In DB.
Def (ObjectIdx PK, ObjectN, ObjectType)
Conf1 (CylinderId PK, Name, ...)
Conf2 (EngineId PK, Name, ...)
Is anyone know how to make relationship with rule below.
Def.ObjectN =Conf1.CylinderId and Def.ObjectType =1
Def.ObjectN =Conf2.EngineId and Def.ObjectType =2
I frogetted... it's MS SQL Server 2000 |
|
|
| Back to top |
|
|
|
| Plamen Ratchev... |
Posted: Fri Oct 30, 2009 7:53 pm |
|
|
|
Guest
|
|
| Back to top |
|
|
|
| ArekK... |
Posted: Fri Oct 30, 2009 8:52 pm |
|
|
|
Guest
|
Uzytkownik "Plamen Ratchev" <Plamen at (no spam) SQLStudio.com> napisal w wiadomosci
news:IuidnYPgG6V6lnbXnZ2dnUVZ_rednZ2d at (no spam) speakeasy.net...
Thanks PR, but this solution i checked before. Sorry, i didn't write this.
In that example you have to add column and fill it the same value.
I'm looking for another idea. |
|
|
| Back to top |
|
|
|
| Hugo Kornelis... |
Posted: Fri Oct 30, 2009 11:22 pm |
|
|
|
Guest
|
On Fri, 30 Oct 2009 17:52:51 +0100, ArekK wrote:
Hi ArekK,
That's the only way using DRI (declare referential integrgity). If you
don't want to do that, then I guess triggers are the only safe option.
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis |
|
|
| Back to top |
|
|
|
|