Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2006, 06:23 PM
Registered User
 
Join Date: Nov 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default copy a database using SQL Server 2000

Hi
I need help in making a copy of Northwind database using SQL server 2000 so that I do not interfere with the original Northwind database which comes with the original MS SQL server 2000 software.
Thanks
 
Old November 19th, 2006, 01:26 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

One of the easiest things to do is to get a nice fresh copy of it from the following URL...

http://www.microsoft.com/downloads/d...displaylang=en

It'll download everything you need to C:\SQL Server 2000 Sample Databases

Open the instnwnd.sql file, change all references to Northwind to (say) PlayWind and all references to Northwnd to PlayWind. Execute the script to make a new DB called PlayWind.

The download takes all of a minute with DSL and the installion of the new DB takes less than 10 seconds.

--Jeff Moden
 
Old November 20th, 2006, 12:00 AM
Registered User
 
Join Date: Nov 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jeff,
Thanks for this. I have managed.
Another quick question. Say if it was not northwind database I am working with. Let say I am in a company and I have to work on their database and need to make a copy of their database and work with that copy. How would I go with that? At least with this northwind there is sample one to download and we are able to change the script file. Will there be some script files for us to change and execute? Thanks again. I am trying to learn SQL by myself so I am prety new to the area.

 
Old November 20th, 2006, 01:15 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

There are several ways... one way is to copy the database (MDF/[NDF]/LDF) files. In most every case I can think of, you will need to either detach the db or stop the SQL Server services to make the copy. Another way is to restore a copy from a backup. Still another way, if both machines are on a network is to use the Copy Database Wizard in Enterprise Manager. The most drastic way is to use some form of replication... it can be a real bugger.

Or, you can gen the database script from Enterprise Manager to create the objects with the understanding that they may not be created in the correct order if any referential integrity is present. Also, no data will be copied using this method.

--Jeff Moden





Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore/copy database from SQL 2005 to 2000 shillr SQL Server 2005 2 April 1st, 2008 11:14 AM
Chpt 3 - Connect to SQL Server 2000 Database BennyHill BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 6 June 7th, 2007 03:30 PM
How to Backup database - SQL Server 2000 cancer10 SQL Language 2 March 1st, 2007 07:21 AM
how to store file in sql server 2000 database vivekkumar_23 SQL Server 2000 1 February 27th, 2006 10:41 PM
How to replicate database using SQL SERVER 2000 debsoft SQL Server 2000 2 June 27th, 2003 04:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.