I need to "refresh" or more accurately fix alot of constraints on a number of tables. All of these tables have some constraints but they are all incorrect and they contain data, and some of them might even be on customer sites *ahem*
So I'm not in a position to do anything export / import wise. least of all becasue all these tables already have lots of data in them.
So I figured the best I could do was clear a night when no other updates were planned and rebuild the constraints by dropping and re-creating them.
Now the problem is I don't have a script with the constraints. I do however have a master account with them set how they should be...
You should be able to create a query that queries sys.all_constraints and sys.all_cons_columns and creates the sql to reproduce them but you probably already knew that. SOL
The best thing about banging your head against a wall is when you stop.
Your best bet may be to get hold of a copy of TOAD ( if you don't already have it ) and use the export table scripts function in this. This will create the scripts to create the tables and constraints, you could then write a text parsing program to strip the create table syntax out. This is how I would do it anyway. SOL
The best thing about banging your head against a wall is when you stop.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.