?
Solved

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

Posted on 2006-11-13
4
Medium Priority
?
459 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

801 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