| Pages: [1] :: one page |
|
|
| Author |
Topic |

Kentaro Kawaii
Gallente Angel of War
 |
Posted - 2008.10.10 02:48:00 -
[1]
Edited by: Kentaro Kawaii on 10/10/2008 02:48:18 How do I export an entire database to a series of .sql files (each .sql file contains all data for a table) in MS SQL 2005?
I used to use the supplied .sql files from the old data dumps and do macros on them, but now I can't since the data dumps are now in .BAK format. I upgraded my SQL server from 2000 to 2005 so that I could use the .BAK files, and I can't figure out how to export to .SQL myself, and Google is not being my friend today. --- Mah Sig! MAAAH SIIIG!! WAAAAAAAAH WHERE MY SIIIGGGG???!!?!!
 |

Jethro Jechonias
Ki Tech Industries
 |
Posted - 2008.10.10 05:35:00 -
[2]
Edited by: Jethro Jechonias on 10/10/2008 05:43:32
Pretty much what you need to do is create a query that returns the data structured like SQL.
For example into a command prompt type (one line):
bcp "SELECT 'INSERT INTO [EveDB].[dbo].[mapJumps] ([stargateID],[celestialID]) VALUES ('+CAST([stargateID] as varchar) +','+CAST([celestialID] as varchar)+')' FROM [dbo].[mapJumps]" queryout "mapJumps.sql" -T -c
However, I would ask why you want to do this, as there are problably better ways to accomplish whatever it is that you are after.
For example, if you want to transfer the data from one database to another on your computer you could run a query like this:
INSERT INTO [NewDatabase].[dbo].[mapJumps] ([stargateID] ,[celestialID]) SELECT [stargateID] ,[celestialID] FROM [OldDatabase].[dbo].[mapJumps]
|

Kentaro Kawaii
Gallente Angel of War
 |
Posted - 2008.10.10 06:21:00 -
[3]
The purpose is to do some macros on the outputted SQL scripts, and then convert to MySQL. --- Mah Sig! MAAAH SIIIG!! WAAAAAAAAH WHERE MY SIIIGGGG???!!?!!
 |

Vessper
Indicium Technologies
 |
Posted - 2008.10.10 07:09:00 -
[4]
I have a utility that converts the MSSQL data into SQL files but these SQL files don't contain the database schema (although I do have a separate file for that).
If it's of any interest to you, I can certainly let you have a copy of these files.
- - -
 EveHQ Character App | Item Database |

Ambo
State Protectorate
 |
Posted - 2008.10.10 07:21:00 -
[5]
Alternatively you can download SQL Server Management Studio Express.
Attach your database, right click it and select 'script to'->file to produce an sql script file of the entire database. You can also do just single tables, table definitions, etc. It's all very configurable. |

Kentaro Kawaii
Gallente Angel of War
 |
Posted - 2008.10.10 07:40:00 -
[6]
Originally by: Ambo Alternatively you can download SQL Server Management Studio Express.
Attach your database, right click it and select 'script to'->file to produce an sql script file of the entire database. You can also do just single tables, table definitions, etc. It's all very configurable.
I've tried that, it seems to only export the structure, no data. And I have the full version of SQL Server Management Studio. |

Gilgamoth
Eldritch Storm The Matari Consortium
 |
Posted - 2008.10.10 10:21:00 -
[7]
Edited by: Gilgamoth on 10/10/2008 10:21:58 Install the MySQL GUI tools and in there is a Migration Toolkit.
I installed SQL Express, imported the .bak file into that and used the migration toolkit to transfer to the MySQL server.
Worked for me 
Regards,
Gil
edit for epic typo |
|
| Pages: [1] :: one page |
| First page | Previous page | Next page | Last page |