SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Not Checking FKs


Not Checking FKs

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)

Group: Administrators
Points: 330233 Visits: 20112
I had someone ask what are the issues if you update data, disabling a FK, and then enabling without check. Can someone write a scenario or two to show the potential issues?

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Lori B
Lori B
Mr or Mrs. 500
Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)

Group: General Forum Members
Points: 556 Visits: 727
Have you had someone submit an article for this? If not, I can take it since I need a new topic to blog on. Let me know.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)

Group: Administrators
Points: 330233 Visits: 20112
Bump

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Hugo Kornelis
Hugo Kornelis
SSC-Dedicated
SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)

Group: General Forum Members
Points: 34426 Visits: 13121
So I guess Lori stepped back?

I can write something about it, but you could also check out this first; http://sqlblog.com/blogs/hugo_kornelis/archive/2007/03/29/can-you-trust-your-constraints.aspx
(The blog post itself uses a check constraint to illustrate the issues, but an example that uses a foreign key can be found in the comments).

If you want an article specific about untrusted FKs, I'll write something up for you. Just let me know.


Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Steve Jones
Steve Jones
SSC Guru
SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)

Group: Administrators
Points: 330233 Visits: 20112
I haven't heard from Lori.

I'd like something here on the topic, more along the lines of what's in your comments. IF you'd like to write something up, I'd appreciate it.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Steve Hood.
Steve Hood.
SSC-Addicted
SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)

Group: General Forum Members
Points: 489 Visits: 206
Chris Bell wrote something on that topic here: https://wateroxconsulting.com/archives/untrusted-foreign-keys/

It doesn't get into the details of how it can change execution plans which is what I think you're looking for.


Steve Hood

Blog: Simple SQL Server
Twitter: @SteveHoodSQL

Lori B
Lori B
Mr or Mrs. 500
Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)Mr or Mrs. 500 (556 reputation)

Group: General Forum Members
Points: 556 Visits: 727
Sorry for the confusion. I was waiting for a note saying that no one else had taken the subject. Unfortunately now I am too busy to do the post so I will definitely step back. Sorry again!
Steve Jones
Steve Jones
SSC Guru
SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)

Group: Administrators
Points: 330233 Visits: 20112
bump

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Hugo Kornelis
Hugo Kornelis
SSC-Dedicated
SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)

Group: General Forum Members
Points: 34426 Visits: 13121
Steve Jones - SSC Editor (4/27/2016)
bump


Huh??
The article is written and already published. Not sure why you are bumping this?


Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Steve Jones
Steve Jones
SSC Guru
SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)SSC Guru (330K reputation)

Group: Administrators
Points: 330233 Visits: 20112
Sorry, mistake. Got tabs confused.

closing.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search