SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to import database files to SQL server
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

arthiasha
Starting Member

India
40 Posts

Posted - 08/17/2012 :  08:26:14  Show Profile  Reply with Quote
I have some SQL server query files, which i need to add it my local SQL server management studio express 2005.

The file contains all the scripts of creating tables, many stored procedures. I FTP it from the server and now i have to add the whole schema into my machine and execute it... i.e i need to import the database into mine... please help to do with steps

sunitabeck
Flowing Fount of Yak Knowledge

5152 Posts

Posted - 08/17/2012 :  08:53:55  Show Profile  Reply with Quote
You should be able to open SQL Server Management Studio, open or copy each file into a query window and execute them (from the top menu Query -> Execute) to execute them. HOWEVER:

Before you do that, look through the files to see what they do. They may need to be run in specific order; for example if one file creates a database and another creates tables in that database, you will need to run the first file before running the second.

If you have a test environment, run them in the test environment to make sure that they are doing what you expect them to do.

Also, after you run each, look carefully at the output and message windows to see if any errors were generated.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47081 Posts

Posted - 08/17/2012 :  10:09:26  Show Profile  Reply with Quote
if you attempt is to import database why not take a backup and restore it to your server? that would be easiest thing to do to get an exact replica of db. Unless db has some sensitive info which you shouldnt be getting access to that would be best way I guess.
If not possible, as Sunita suggested you need to analyse and determine sequence of scripts before you apply them.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000