mario17 (4/18/2014)
Hi, ALLI Just checking a newly deisgned db at my new place, AND see there is NO FK contraints EXISTS FOR many tables, so
you can enter:
INSERT INTO tProdValues (Value, CategoryID) rows with any CategoryID (eg. = 99), even
they don't exist in tCategoryTypes, is this OK?
I thought that it alwayse shoud be SOME checking..
Thanks
Mario
It is impossible to say if it is ok or not from the extremely vague information posted. I can say that it sounds like referential integrity (RI) is a bit lax in that system. Assuming you have a table for CategoryTypes it is generally best to make a foreign key reference to that when using that type in another table. It doesn't make it "wrong" but it certainly raises some red flags.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/