Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

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....
0
William
Asked:
William
  • 3
  • 3
1 Solution
 
Vitor MontalvãoMSSQL 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help 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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now