i have a question on mdf /  ldf

Posted on 2003-12-05
Last Modified: 2010-05-18
i have a data file which is

how can i bring the data file into sql server?
Question by:khan2000
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
  • 2
  • +1
LVL 34

Expert Comment

ID: 9886158
Do you mean you have existing files you want to load to sql server?

Just copy them to the server and execute this from query analyzer:

sp_attach_db 'whatyouwanttocallit','path:\auto.mdb','path:\auto.ldf'


Accepted Solution

Dishan Fernando earned 50 total points
ID: 9887014
EXEC sp_attach_db @dbname = N'auto',
   @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\auto.mdf',
   @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\auto.ldf'
Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

LVL 50

Expert Comment

ID: 9887510
Hi khan2000,

assuming the files are sql server files which where properly detached for there existing server
and that that server is / was at the same patch / version level as the server you are
trying to install them on...

LVL 50

Expert Comment

ID: 9887511
and please maintain your old questions....
9 open questions:
12/06/03 "i have a question on mdf /  ldf"
11/21/03 "free news server nntp"
11/21/03 "difference between sql 6.5 vs 7.0 vs 200..."
11/13/03 "does anybody have mcdba cbt?"
11/11/03 "I NEED very good web sites for..."
10/28/03 "pop account"
10/07/03 "display a status window"
09/22/03 "i need logic pls."
09/12/03 "how do i write code in aspx"
LVL 30

Expert Comment

ID: 9895740
Hopefully 'mdb' was a typo. MDB is an Access file (unless of course it was renamed from MDF)

LVL 34

Expert Comment

ID: 9896424
yes, it was a typo--I'm aware of the difference between and MDB and MDF.....
LVL 30

Expert Comment

ID: 9896923
My comment was addressed to the original question.... I figured you would know!  :)

Featured Post

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

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…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

717 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