Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtual SQL Server 2014 Standard 35 87
Join with a SQL Server STUFF 5 33
SQL USE DATABASE VARIABLE 5 27
SQL Quer 4 21
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.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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.
Viewers will learn how the fundamental information of how to create a table.

808 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