Solved

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

Posted on 2008-06-24
6
306 Views
Last Modified: 2012-06-21
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
Comment
Question by:William
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 50

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 21864603
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
 
LVL 11

Author Comment

by:William
ID: 21865642
WHat kind of script...  create/drop/etc... ????
0
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 21865676
Just script all objects and don't worry. :)
SQL Server will do the rest for you.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 11

Author Comment

by:William
ID: 21866089
Will this allow me to keep the data in the modified db?
0
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 21866705
No. You'll need to import all data again.
0
 
LVL 11

Author Closing Comment

by:William
ID: 31470418
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question