Groups | Blog | Home
all groups > sql server clients > april 2004 >

sql server clients : jeff


antz
4/28/2004 7:59:16 AM

SQL .mdf file import.
How can i import a .mdf file(291MB in size) into a txt
file?
a step by step guide - as i know nothign about SQL 2000
thanks / Regards,

anonymous NO[at]SPAM discussions.microsoft.com
4/28/2004 10:43:41 AM
thanks -
how do i go about attaching the mdf file?
to export it?
thanks

Jeff
[quoted text, click to view]
Hari Prasad
4/28/2004 9:13:41 PM
Hi,

You can't import/export from a physical SQL server data file to a text file
or viceversa.
To do this first attach the MDF file as a database inside SQL server. After
that use the SQL server utilities BCP OUT or DTS to export the data from
tables to a Text file.

Thanks
Hari
MCDBA



[quoted text, click to view]

Hari
4/29/2004 8:43:46 AM
Hi Jeff,

Login to SQl server using the Query analyzer and try attaching the MDF file
as a database.

sp_attach_single_file_db
'dbname','physical_file_name_of_mdf_file_with_exact_path'

Note:

Normally each database consists of 1 MDF and 1 LDF (Transactionlog) file. In
your case it seems you do not have the LDF file. So the above command may
file due to below reasons:-

1. If the database is not detached earlier
2. If the original database had more than 1 LDF files.

If your case does not fall in above categories then you will be able to
attach and then you can export contents to a text file using DTS or BCP.

Thanks
Hari
MCDBA


[quoted text, click to view]

AddThis Social Bookmark Button