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
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.
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/