Solved

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

Posted on 2006-11-13
4
417 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now