?
Solved

how to disable foreign key constraints

Posted on 2007-03-22
1
Medium Priority
?
332 Views
Last Modified: 2010-03-19
I have two tables TEST_TABLE and TEST_TABLE_02. TEST_TABLE_02 having some foreign key constraints to TEST_TABLE. I want to drop TEST_TABLE because I want to make an int field an IDENTITY field. When I issue DROP TABLE TEST_TABLE, I get the following error

Could not drop object 'TEST_TABLE' because it is referenced by a FOREIGN KEY constraint.

I know I have to drop the constraints on the TEST_TABLE_02 for instane foreign key constraint but for some reason I do not want to do it.

Is it possible to disable constraints for a time being and later enable 'em.

Thanks in advance
0
Comment
Question by:rxraza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
kosturdur earned 750 total points
ID: 18776192
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question