SQL Script Dependencies and Contraints -> OUT to pull into modified db

I have 2 databases... One original and one modified (they are UGLY) :)  
My issue is that after the modification to the 'modified' one, alot of the contraints/dependencies seem to have been exluded or rearranged....
150+ tables datatype change from int to varchar(30) was the modification (dont ask, as I inherited this with much resistance... :))
What I would like to be able to do:
1. script the contraints and foriegn key stuff (I am not a sql dba at all) from the original
2. change the script if needed to reflect the varch(30)
3. run the cript on the modified db....

Any suggestions/solutions/tools / ???????

Thanks for your time....
LVL 11
WilliamAsked:
Who is Participating?
 
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
You can generate scripts by right-clicking over databbase name in SQL Server Enterprise Manager (SQL Server 2000) or in SQL Server Management Studio (SQL Servr 2005) and then choose "Generate SQL Scripts...".
After you generate script use a file editor and with a simple find/replace modify it.
Save it and run it over new DB.

Good luck
0
 
WilliamAuthor Commented:
WHat kind of script...  create/drop/etc... ????
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Just script all objects and don't worry. :)
SQL Server will do the rest for you.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
WilliamAuthor Commented:
Will this allow me to keep the data in the modified db?
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
No. You'll need to import all data again.
0
 
WilliamAuthor Commented:
I had to learn quite a bit here...     All said it was worth not having a hand holding mine!!!   Thanks for direction!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.