Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Programming
»
SMO/RMO/DMO
»
NO CHECK instead of CHECK on Primary Key
NO CHECK instead of CHECK on Primary Key
Rate Topic
Display Mode
Topic Options
Author
Message
anitae
anitae
Posted Monday, September 30, 2002 6:40 PM
Grasshopper
Group: General Forum Members
Last Login: Monday, April 20, 2009 7:49 AM
Points: 21,
Visits: 19
I am using DMO to create tables and primary keys. When I profile the server, I see that the primary key is created with a CHECK constraint. This must be the default because I am not setting this in my code.
I would like to generate a line of code like this:
ALTER TABLE tablename WITH NOCHECK ADD CONSTRAINT and so on......
instead of
ALTER TABLE tablename WITH CHECK ADD CONSTRAINT and so on.....
I see that the key object has a "Checked" property which I set to false, but I am not sure where to put the line of code.
Thanks for your help.
Post #7111
Andy Warren
Andy Warren
Posted Saturday, October 12, 2002 8:12 PM
SSCertifiable
Group: Moderators
Last Login: Tuesday, June 11, 2013 6:34 AM
Points: 6,463,
Visits: 1,388
Sorry it took so long. The checked property only applies to foreign keys. Primary keys are represented as indexes even though they are also indexes - the index being the method by which the constraint is enforced.
Andy
http://www.sqlservercentral.com/columnists/awarren/
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #42630
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.