Solved

Copy, Attach or Restore DB from CD to SQL Server 2000

Posted on 2006-11-13
4
433 Views
Last Modified: 2008-01-09
Hi ! I have a DB which I unzip from a CD 150 files including .mdf & .ldf & put in (Actually log is in different drive), but I want DB available ASAP, and getting Error so I put in same directory.

E:\Program Files\Microsoft SQL Server\MSSQL\Data\abc.mdf
E:\Program Files\Microsoft SQL Server\MSSQL\Data\abc.ldf

and 139 .ndf files.
I try to attach with Enterprize Manage but got error then tried with sp_attach_db (Error 8144: Procedure or function sp_attach_db has too many arguments specified).
Is there any other or simple way I can resolve this problem.
Note: The server already had DB XYZ which I already Deleted, and restored want to restored with the Same Name I don't have any .BAK file, so i can't force restore any alternate.
Any Help will be highly appreciated ASAP, as I am running out of time.
Thanks

0
Comment
Question by:ghazni787
  • 2
  • 2
4 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17930166
EXEC sp_attach_db @dbname = N'abc  ',
   @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\abc.mdf',
   @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\abc.ldf'

0
 

Author Comment

by:ghazni787
ID: 17930583
I ran that script, getting the same problem, with 148 error with .ndf (these are the tables names in DB abc), I am searching the D drive location, as Data & logs are on diffrent drive.


Server: Msg 5105, Level 16, State 5, Line 1
Device activation error. The physical file name 'D:\builds\Company123\SQL2000\MQASQL\data\abc1_Basic_data.ndf' may be incorrect.
Server: Msg 5105, Level 16, State 1, Line 1
Server: Msg 5105, Level 16, State 5, Line 1
Device activation error. The physical file name 'D:\builds\Company123\SQL2000\MQASQL\data\abc2_Basic_data.ndf' may be incorrect.
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 17932271
I hope u have more than one datafile
EXEC sp_attach_db @dbname = N'abc  ',
   @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\abc2_Basic_data.mdf',
   @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\abc2_Basic_data.ndf',
   @filename3 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\abc.ldf'

0
 

Author Comment

by:ghazni787
ID: 17950878
Hi ! aneeshattingal

Thanks your Answer is right for one part , I want the easy solution If you Have? as I have to finish before your answer came, here I have to write 148 time the .ndf , as only 16 support in sp_attach or through EM. I will put later the Solution as my friend helps me.

Thanks
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

786 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