473,394 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

SQL script to remove constraints

Hi!

I need to write a script that will remove any constraints and triggers from
any table in a specified database.
My problem is that i don't know where are stored in the system tables the
constraints and relations... I've been told that once this would be found,
i would just have to use cursor in order to remove those.
And by the way, i'll need to re-apply the constraints after a couple of
operations on the databases...

Is this something i can possibly do? Do you have any clue or tips for me?
Thanks!

Etienne
Jul 20 '05 #1
1 9605
Etienne:

SQL Server MVP Narayana Vyas has some scripts on his website that you
may find helpful.

http://vyaskn.tripod.com/generate_sc..._sql_tasks.htm

HTH

BZ

"Etienne M. St-Georges" <no************@emstg.com> wrote in message news:<Fr********************@news20.bellglobal.com >...
Hi!

I need to write a script that will remove any constraints and triggers from
any table in a specified database.
My problem is that i don't know where are stored in the system tables the
constraints and relations... I've been told that once this would be found,
i would just have to use cursor in order to remove those.
And by the way, i'll need to re-apply the constraints after a couple of
operations on the databases...

Is this something i can possibly do? Do you have any clue or tips for me?
Thanks!

Etienne

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jason Madison | last post by:
We sometimes get very large databases that we want to cut down to use for testing. The information is all related to a central accounts table. The way I thought of doing this is to grab all...
1
by: Matik | last post by:
Hello, I need to change collation in my database (more databases acctualy). Therefore, I wanted to make a script, which will do it at one more time. I already have a cursor, updating...
6
by: rabii | last post by:
Hello, I'm using Entreprise Manager (for Sql Server 2000) to generate my database's script. By mistake, i've changer FillFactor one time. And, now I can't remove this data from generated sql...
4
by: Dmitri | last post by:
I just looked at a coworker's stored procedure and this person is dropping 4 Foreign key constraints and then re-adding them after processing the required logic (updating rows in the 4 tables in...
4
by: trint | last post by:
Ok, This script is something I wrote for bringing up a report in reporting services and it is really slow...Is their any problems with it or is their better syntax to speed it up and still provide...
2
by: yongsing | last post by:
I have two tables as shown below (only relevant columns shown). The second table is dependent on the first one. CREATE TABLE PARENTTABLE ( ... SERIAL CHAR(12) NOT NULL, ENDDATE TIMESTAMP NOT...
2
by: Agnes | last post by:
In my Form, there is Invoice Master to - InvoiceDetail (one-to-may relationship) I use bmMaster.removeat(bmMaster.position) to remove the Master record. However, I don't know how to remove the...
80
by: Andrew R | last post by:
Hi I'm creating a series of forms, each with with around 15-20 text boxes. The text boxes will show data from tables, but are unbound to make them more flexible. I want the form to be used...
10
by: leonel.gayard | last post by:
Hi all, I have a script responsible for loading and executing scripts on a daily basis. Something like this: import time t = time.gmtime() filename = t + '-' + t + '-' + t + '.py' import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.