Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
YAQ on Foreign Key constraint
Message
From
29/03/2010 09:54:41
 
General information
Forum:
Microsoft SQL Server
Category:
Database management
Miscellaneous
Thread ID:
01457802
Message ID:
01457827
Views:
36
>>I agree. The other approach I thought is to enter a "dummy" record with blank entry in the primary table and "hide" it from the user. But maybe I will learn to live (code) with NULLs instead of empty entries.
>
>There're three cases where I find NULLs useful
>- Dates
>- FK
>- The columns where it's important to know difference between "empty" and "unknown" values
>
>>Speaking about triggers. Do I understand correctly that specifying foreign key constraint with cascade option is pretty much the same as used to be done with triggers to update foreign keys?
>
>Yes, FK used to be implemented in SQL Server with triggers up to SQL 2000.

Thank for your help. I agree that NULL is useful in all the cases you mentioned; I just need to reprogram some things to get used to this.

P.S. Something really weird happened to me for the 1st time in all the years I use SQL Server. I just had SSMS crash; never before experienced that. I simply selected to modify one of the tables and it crashed. When I started SSMS again it showed me the files that I can recover (queries). I wonder if this was the issue with SSMS or my SQL Server caused the crash?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform