473,598 Members | 3,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drop and recreate constraints

1 New Member
Hi,

We have a script that drops the constraints for all user tables in MS SQL Server 2000. Is there a way to script in recreating the same droped table constraints?

We want to disable the constraints to be able to truncate the user tables and then apply the same constraints after truncating.

Thanks.
Sep 11 '07 #1
0 2059

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3852
by: D | last post by:
Database 1 is corrupted. Database 2 was created by dba but none of the primary or foreign key constraints were ported over. TOAD won't let me export. I will try ErWin next. What is the best way to recover this information if the views are corrupted and through errors? thanks, Lowly developer
1
1710
by: tchangmian | last post by:
I am using SQL Server 2000 and i would like to find out how to write the syntax in stored procedure for dropping the constraints within the table. Below is the request for my case: 1)Perform "duplicate" checking on the cardsmart database for rd_awards table before dropping the existing Rewards_Catalog_Product_CS table in web database 2)If gift code "duplicate", Rewards_Catalog_Product_CS table will not
5
51496
by: Markus | last post by:
I tried this: ALTER TABLE Dokumente DROP COLUMN docPrioID but I get this errormessage: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: COLUMN;ABLE Dokumente DROP;CONSTRAINT
1
2964
by: Matt | last post by:
I have a parent table that has 2 child tables. I need to drop and recreate the parent table because there has been a change to one of the column types. What should I do prior to dropping the table to make sure that when recreated and reloaded it will identify the child tables? This may sound like a dumb question. In test, I exported the data out then dropped the table and recreated it and reloaded the data. However, after reloading the...
5
17280
by: sreemati | last post by:
Hi I am working on SQL SERVER 200 and I am trying to drop the default constraints set in few tables. I tired to follow the instructions given in MSDN for dropping a default: 1) Unbind the code Exec sp_unbindefault 'tablename.columname' When I try to run it, it gives me following this error message: Server: Msg 15049, Level 11, State 1, Procedure sp_unbindefault, Line 98
0
2147
by: okonita | last post by:
DB2v8.2 LUW. Unable to drop Foreign Key constraints...although DROP constraints returns undefined name. Am I missing somrthing here? Hi all, I have a perplexing DB2 Drop command situation. Environment I have tried severally to drop Foreign Key constraints on a set of tables and each time I get a SQL0204N "SQL071030104307060" is an undefined name. ". However, when I go back to look at the table or load data, I get a constraint error...
1
7167
by: dsdevonsomer | last post by:
Hello all, I am new to managing indexes on large tables and need some help. Hopefully, I am not repeating question here. I searched as much as I can, but not finding relatively best answer.. Here is my scenario. I have 2 tables with more than 4 mil rows (1 - 2.8 Mil, 2 2.1 mil). Of these tables, there are about 25 ( select ) queries run to help generate reports every week.
4
12901
by: Joseph | last post by:
Can i drop a cloumn from a table in DB2 for Z/OS?
2
3058
by: ianp99 | last post by:
Hello, we have two databases. One has all the tables and foreign key constraints set up correctly. The other is missing all the FK constraints as the import failed. My question is: How can I export the FK constraints from the first database and import them into the second database? many thanks Ian
0
7987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8050
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6718
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5850
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3897
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.