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


CHECK CONSTRAINT


CHECK CONSTRAINT

Author
Message
maechismo_8514
maechismo_8514
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4226 Visits: 2228
Comments posted to this topic are about the item CHECK CONSTRAINT
Hugo Kornelis
Hugo Kornelis
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18881 Visits: 12426
I don't have a test setup here to quickly double-check, but if I read the documentation correctly the NOT FOR REPLICATION will not cause the constraint to exist only at the publisher. Here's the quote:

"The check constraint is not enforced when a replication agent performs an insert, update, or delete operation."

I interpret this as "the constraint itself is replicated to the subscriber and it will also be enforced there with respect to 'local' (manual) inserts and updates, but inserts and updates from a replication agent are explicitly exempted".

Can someone who can easily create a test setup please double check if this is a documentation error, or just a badly formulated QotD?

Oh, and Steve might also want to fix the two identical answer options in this question...


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
navnath.n.kale
navnath.n.kale
Say Hey Kid
Say Hey Kid (672 reputation)Say Hey Kid (672 reputation)Say Hey Kid (672 reputation)Say Hey Kid (672 reputation)Say Hey Kid (672 reputation)Say Hey Kid (672 reputation)Say Hey Kid (672 reputation)Say Hey Kid (672 reputation)

Group: General Forum Members
Points: 672 Visits: 48
I have not cross checked it but gone through some of the articles.

in one of blog I found that Constraints should be on Subscriber database.

Plz refer : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=113154

Plz correct me if I am wrong.

-Navnath
michael.kaufmann
michael.kaufmann
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1581 Visits: 1082
Unfortunately I don't have a test setup at hand either and perhaps I'm again misinterpreting the information in the MSDN article the QotD is referring to, but in my opinion a 'choose all that apply' would have been the proper option for the question:

The NOT FOR REPLICATION option can be specified in the following ways:

- [...]

- Directly in Transact-SQL syntax or in Microsoft SQL Server Management Studio when:

- Creating or modifying an object in the publication database.
- Creating or modifying an object in the subscription database. [...]
noeld
noeld
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22862 Visits: 2048
This is a BAD formulated question. I got right because I guessed the intentions of the author. The constraint DOES gets created on the subscriber just not enforced!

If you don't want the definition at all on the subscriber, you suppress it with the schema_option parameter of the article.


* Noel
Rin Sitah
Rin Sitah
SSChasing Mays
SSChasing Mays (659 reputation)SSChasing Mays (659 reputation)SSChasing Mays (659 reputation)SSChasing Mays (659 reputation)SSChasing Mays (659 reputation)SSChasing Mays (659 reputation)SSChasing Mays (659 reputation)SSChasing Mays (659 reputation)

Group: General Forum Members
Points: 659 Visits: 548
Answers C and D appear to be identical...

Disable CHECK constraint at the Subscriber database
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