Solved

how to disable foreign key constraints

Posted on 2007-03-22
1
293 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
1 Comment
 
LVL 5

Accepted Solution

by:
kosturdur earned 250 total points
ID: 18776192
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

772 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