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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Create/attach/restore database with mdf file

Author  Topic 

Harris00
Starting Member

19 Posts

Posted - 2009-03-30 : 16:10:51
Hello

I received mdf file from a site and would like to create or restore or attach that mdf file on my local machine, i tried creating using the location the mdf file was saved but no success and restore or attach doesnt seem to work?
how should i go about adding this database to my server and view?

Any help would be appreciated grealty?

Armani

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-03-30 : 16:42:05
Try using sp_attach_single_file_db to attach it without the LDF file. Let us know what error you get.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-03-30 : 22:32:38
Can you give some backgrounds as well?Like from which version?
Go to Top of Page

Harris00
Starting Member

19 Posts

Posted - 2009-03-31 : 15:22:45
below is the message i am getting

New log file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TEST_Data_log.LDF' was created.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'TEST_Data'. CREATE DATABASE is aborted.
Msg 824, Level 24, State 2, Line 1
SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:96712; actual 0:0).
It occurred during a read of page (1:96712) in database ID 11 at offset 0x0000002f390000 in file
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TEST_Data.MDF'.
Additional messages in the SQL Server error log or system event log may provide more detail.
This is a severe error condition that threatens database integrity and must be corrected immediately.
Complete a full database consistency check (DBCC CHECKDB).
This error can be caused by many factors; for more information, see SQL Server Books Online.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-03-31 : 15:37:19
Your database is corrupt. Post the entire output of DBCC CHECKDB in the Data Corruption forum here to see if someone can help you resolve that.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

Harris00
Starting Member

19 Posts

Posted - 2009-03-31 : 15:42:25
i cannot run the DBCC CHECKDB because it does not exist on my server, as mentioned i got this file from site n have to attach it to my server but cannot do it as i run into errors doing that....
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-03-31 : 16:14:24
Yes sorry about that. Post the attach output in the Data Corruption forum.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -