Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 use sp_attach_db proc

Author  Topic 

vasu4us
Posting Yak Master

102 Posts

Posted - 2006-11-15 : 11:46:35
I am trying to use sp_attach_db SP.
I have a dadafile and a log file at D:\Asset
which I am trying to extract using

EXECUTE sp_attach_db 'Asset',
'D:\Asset\Asset_data.mdf',
'D:\Asset\asset_log.ldf'

can any one of u tell where i went wrong
I am getting this errror "Device activation error. The physical file name 'D:\Asset\aa\Asset_data.mdf' may be incorrect."

I am trying to use the database provided from
http://www.trigonblue.com/sp_download.htm#Diagram
to practise stored procedures.

Thanks in advance

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-11-15 : 11:54:12
The error says you are using the path D:\Asset\aa but you gave the path as D:\Asset in the command you're trying to use.

If you use the command you say you are, and the files are in the D:\Asset folder then it will work fine.
Go to Top of Page

vasu4us
Posting Yak Master

102 Posts

Posted - 2006-11-15 : 13:08:44
I have the files at 'D:\Asset\Asset_data.mdf',
'D:\Asset\asset_log.ldf'
I connect to a remote SQL server using Query Analyzer which opens a window with master DB connection
and when i run this comand

EXECUTE sp_attach_db 'Asset',
'D:\Asset\Asset_data.mdf',
'D:\Asset\asset_log.ldf'

I am getting the same error
Device activation error. The physical file name 'D:\Asset\Asset_data.mdf' may be incorrect.
Go to Top of Page

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-11-15 : 13:44:04
OK, in that case are your files on the D: drive of your computer or the server? They must be on the server's D: drive.
Go to Top of Page

vasu4us
Posting Yak Master

102 Posts

Posted - 2006-11-15 : 14:34:59
you were right on dot
i copyed the files to server and then it worked.

thank you
Go to Top of Page
   

- Advertisement -