We help IT Professionals succeed at work.

Export SQL DB to CSV file

Hello,

I have a website that is using MS SQL 2005 data base, I'm in process of migrating a website to a new hosting solution, on the new hosting I'm only able to import DB in a CSV format. How can export my DB to a CSV format? I have an access to a MS SQL Management Studio Express.

Thank you,

Sergey
Comment
Watch Question

Commented:
Not sure whether that's even possible. ( well everything is possible , not supported...)

If you have a limited set of tables , and limited relations between your tables, I'd do the following.

Right click on the DB in MS SQL Management Studio --> TASKS --> select flat file as output and the tables.
This will only export the data on the tables.

The DB structure itself you can only output this to a sql file ( as far as I know, still being readable).

RClick DB -> Script DB as -> Create->...
Database Analyst
CERTIFIED EXPERT
Commented:
"I have a website that is using MS SQL 2005 data base, I'm in process of migrating a website to a new hosting solution, on the new hosting I'm only able to import DB in a CSV format. "

You realize that the website has some code(connections,etc) running against a SQL Server so that(those) SQL Server database(es) must be migrated as well right? That unless the whole wbsite is re-written to use csv or other files as your data source...

If the new host will let you only import data via CSV files you still need that(those) db(s) created prior to that so you would need to script it first on the existing SQL Server and run the script to create it on the new host.

After that you could use the EXPORT/IMPORT SQL Server wizard for dataexport/impport but besides that in my opinion you need to transfer ALL the logins from old box, all scheduled jobs, maintenance plans, etc.

http://msdn.microsoft.com/en-us/library/ms141209(v=sql.90).aspx

Author

Commented:
Thank you All, I went a different way, I have opened a new hosting that lets me import SQL DB in a normal .sql or .bak formats.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.