Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-11-13
4
Medium Priority
?
467 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

604 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