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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 about foreign key

Author  Topic 

dasu
Posting Yak Master

104 Posts

Posted - 2004-10-14 : 07:14:32
please suggest me the solution about
reference key

the situation is like this
i have to tables
1.t_cbs_rqst_dtls(err_rsn)
2.t_cbs_epilkup (err_rsn)
so now i did foreign key between above two fields
can i insert null value in t_Cbs_rqst_dtls table for err_rsn field.
regards
dasu.g


spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-10-14 : 07:35:10
if t_Cbs_rqst_dtls is child then no, if it's parent then yes
provided err_rsn is the key.


Go with the flow & have fun! Else fight the flow
Go to Top of Page

hgorijal
Constraint Violating Yak Guru

277 Posts

Posted - 2004-10-14 : 07:41:27
or is it the other way round !!!!

Parent can't have a null in Primary key, child can have a null in foreign key. ;)


Hemanth Gorijala
BI Architect / DBA...
Exchange a Dollar, we still have ONE each.
Exchange an Idea, we have TWO each.
Go to Top of Page

sinapra
Starting Member

24 Posts

Posted - 2004-10-14 : 07:47:15
I think child can have null, since any child field needs reference and if if child has value and parent hs none, it returns an error.

Cheers
Go to Top of Page
   

- Advertisement -