How to remove, then re-add table constrains

curiouswebster
curiouswebster used Ask the Experts™
on
I need to start a script by removing table constraints, then  create a script to return them.

Can I simply Right Click the constrain, Script As, DROP To and CREATE To, then use those exact scripts in my script?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Database and Application Developer
Commented:
You can drop but then you have to use TSQL:
Alter TableName Add Contraint... as applicable
AneeshDatabase Consultant
Top Expert 2009
Commented:
yup, you can generate the scripts that way.
curiouswebsterSoftware Engineer

Author

Commented:
You mean drop the constraints?

I plan to use T-SQL in both cases
Commented:
Yes you can use that script generated by sql server for both DROP and Create. This wil be a TSQL script.
curiouswebsterSoftware Engineer

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial