dbTalk Databases Forums  

DTS Checking Constraints

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Checking Constraints in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Tissington
 
Posts: n/a

Default DTS Checking Constraints - 10-21-2005 , 11:23 AM






I have a db with a number of Foreign Keys (all with the Check Constraints
UNCHECKED)

When I run my DTS package it seems to be ignoring this and checking the
constraints.

How can I disable this when the FK is created from my DTS package ?

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com




Reply With Quote
  #2  
Old   
Michael Cheng [MSFT]
 
Posts: n/a

Default RE: DTS Checking Constraints - 10-22-2005 , 02:16 AM






Hi Michael,

We should use NOCHECK instead of UNCHECKED when altering a existing
constraint to be invalid. I made a sample on my side with DTS and it works.

CREATE TABLE Test2
(
TID INT Primary KEY,
CID INT IDENTITY(1,1) UNIQUE
)

INSERT Test2 VALUES (11)
INSERT Test2 VALUES (12)
INSERT Test2 VALUES (13)
INSERT Test2 VALUES (14)

--SELECT * FROM Test2

CREATE TABLE Test2Child
(
TCID INT FOREIGN KEY REFERENCES Test2(CID),
TC CHAR(1)
)

INSERT Test2Child VALUES (55,'B')
--The statement above will fail
ALTER TABLE Test2Child NOCHECK CONSTRAINT FK__Test2Child__TCID__48CFD27E

INSERT Test2Child VALUES (55,'B')
--The statement above will do since we have altered NOCHECK
--Use a DTS package to do the test, it also works

NOTE that if you have specified NOCHECK for the constraint, it will not
check the constraints any more.

Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #3  
Old   
Morgan Ma
 
Posts: n/a

Default RE: DTS Checking Constraints - 10-26-2005 , 01:42 AM



Are you Cheng Ming Qing?
--
Load the whole world into One warehouse and Mine it whatever you want


"Michael Cheng [MSFT]" wrote:

Quote:
Hi Michael,

We should use NOCHECK instead of UNCHECKED when altering a existing
constraint to be invalid. I made a sample on my side with DTS and it works.

CREATE TABLE Test2
(
TID INT Primary KEY,
CID INT IDENTITY(1,1) UNIQUE
)

INSERT Test2 VALUES (11)
INSERT Test2 VALUES (12)
INSERT Test2 VALUES (13)
INSERT Test2 VALUES (14)

--SELECT * FROM Test2

CREATE TABLE Test2Child
(
TCID INT FOREIGN KEY REFERENCES Test2(CID),
TC CHAR(1)
)

INSERT Test2Child VALUES (55,'B')
--The statement above will fail
ALTER TABLE Test2Child NOCHECK CONSTRAINT FK__Test2Child__TCID__48CFD27E

INSERT Test2Child VALUES (55,'B')
--The statement above will do since we have altered NOCHECK
--Use a DTS package to do the test, it also works

NOTE that if you have specified NOCHECK for the constraint, it will not
check the constraints any more.

Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
  #4  
Old   
Michael Cheng [MSFT]
 
Posts: n/a

Default RE: DTS Checking Constraints - 10-27-2005 , 01:36 AM



Hi,

Welcome to MSDN Managed Newsgroup!

Yes, I am Cheng. If you have any questions or concerns, you are welcome to
raise it in the newsgroup.


Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.