jana
asked on
SQL Script for identify if a table has foreign keys and how to disable-enable them
We have to do change all our tables Master ID codes for security purpose. We have a lot of tables and just finished all the scripts necessary for the change.
We were told that we have to first disable any foreign keys between the tables, then do the actual ID change and finally enable the foreign keys again.
1. Since we have a lot of tables, is there a script we can use to know what tables
have foreign keys?
2. Is there a way via script to disable/enable foreign keys?
3. Finally, based on EE experiences on this type of task at hand, any other consideration
prior performing this task?
Thank you very much!
We were told that we have to first disable any foreign keys between the tables, then do the actual ID change and finally enable the foreign keys again.
1. Since we have a lot of tables, is there a script we can use to know what tables
have foreign keys?
2. Is there a way via script to disable/enable foreign keys?
3. Finally, based on EE experiences on this type of task at hand, any other consideration
prior performing this task?
Thank you very much!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
We run the script in our SQL 2000 and it give error. It seems that wring syntax for SQL 2000.
Please advice
Please advice
ASKER
Whats the syntax for SQL 2000
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great thanx!... how about disabling / enabling them, can it be done and does it have any negative effect is we disable then enable?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx! any side effect or bad effect when doing these enable/disable?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx!
ASKER
Thanx
ASKER