Hello guys!
I'm really a newbie in sql stuff, but I have an mdf
file and I need to get the data from there to excel
(xls or csv). I have installed mssql server desktop
edition and I need to connect my mdf database to
server. How can I do this. I know there is some thing
called sp_attach... but how can I use it? I REALLY NEED
A DETAILED EXPLAINATION. Information that "use
sp_attach..." does'nt help me.
Pleeeeeeeaase help me,
Jessicawell you can use sqlserver enterprise manager right click on databases all tasks, attach database or use a stored procedure:
EXEC sp_attach_single_file_db @.dbname = 'pubs',
@.physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'
to detach dabase :
right click on database name all tasks, detach database
or using stored procedure
EXEC sp_detach_db @.dbname = 'pubs'
example are from books online
bye
Originally posted by Jessica7
Hello guys!
I'm really a newbie in sql stuff, but I have an mdf
file and I need to get the data from there to excel
(xls or csv). I have installed mssql server desktop
edition and I need to connect my mdf database to
server. How can I do this. I know there is some thing
called sp_attach... but how can I use it? I REALLY NEED
A DETAILED EXPLAINATION. Information that "use
sp_attach..." does'nt help me.
Pleeeeeeeaase help me,
Jessica|||Thank you Hotwebber!
I have opened SQL server enterprice and on the left panel
I right-clicked on database and All tasks, but there are only
backup database, restore database, import data and export
data. But no database attaching. I'M STILL STUCK.
Please help,
Jessica|||did you try stored procedure ??
Originally posted by Jessica7
Thank you Hotwebber!
I have opened SQL server enterprice and on the left panel
I right-clicked on database and All tasks, but there are only
backup database, restore database, import data and export
data. But no database attaching. I'M STILL STUCK.
Please help,
Jessica|||I don't know how to use this stored procedure.
Can you give me an exaple when I have a
file called database.mdf on my d:\ root directory
Jessica|||I don't know why but it says that I don't have any privat messages,
so I did'nt see your previous message also|||if you know original db name substitute MyDatabase in the sp command:
open sql query analizer this can be done from enterprise manager Tools or start - programs microsoft sql server - query analizer
paste the command
EXEC sp_attach_single_file_db @.dbname = 'MyDatabase',
@.physname = 'd:\database.mdf '
press F5 or click the green triangle
Hotwebber|||Sorry for being so dumb, but how can I know "original db name"? I only have one file called database.mdf
Jessica|||try using MyDatabase as name
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment