Home > Ask the SQL Server Experts > SQL Server Expert Archive Questions & Answers > Restoring backups to a different server and creating a text file for bulkcopy
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Restoring backups to a different server and creating a text file for bulkcopy

EXPERT RESPONSE FROM: Bianca Blount

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 04 June 2001

Can I recreate the logins, databases, transaction logs, maintenance plans and jobs on the new SQL server either by attaching mdf and ldf files (copying them to new server) from old server or by restoring the *.bak files of all the sys and user databases. How do I create a text file so I can use that text file for bulkcopy or to transfer data from one place to another?


>
EXPERT RESPONSE

It is possible to restore the backups to a different server; however, the code page and sort orders of the two servers should be the same. The first database to restore is master (it contains database and user login information). To restore the master database:

  1. Stop the sql server services using the Service Manager
  2. Open a command window
  3. Start sqlserver in single user mode using the sqlservr.exe -m command from a command prompt
  4. Open a second command window connect to sqlserver using osql
  5. RESTORE the master database
  6. Use the SHUTDOWN command to shutdown SQL Server
  7. Restart sql server services using the Service Manager

The remaining databases can be restored using Enterprise Manager; the jobs are in the msdb database while maintenance plans and transaction logs are part of the user database backups. Verify database users are mapped to the appropriate SQL Server accounts using the sp_change_users_login stored procedure.

There are two methods for creating a text file for bulkcopy.

  1. Using DTS create a package that will extract data from a table, view, or SELECT statement to a comma delimited text file
  2. Using Query Analyser modify the output to use comma separated values, run a query, save the output

For further information look in Books On Line for:

  • Restoring the master database from a current backup
  • osql Utility
  • SHUTDOWN
  • RESTORE

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
SQL Server Expert Archive
Applying LDF file to MDF without turning it to .BAK first?
Any way to alias a call to functions?
"Max connections reached" error
Application freezes for 30 seconds on VPN
Adding column and changing datatype
Converting varchar columns to text data type
Adding new column to table that is part of replication
Any issues with linking 7.0 and 2000 databases?
'Format' in SQL Server
Accessing SQL Server databases on an intranet with VB.NET

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SQL Solutions - SQL Database Design
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2005 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts