Converting SQL databases to .csv format

03/18/2012 14:58 liston28727#1
How to convert databases to .csv format. i can use the "create to" option on the database table but when i open the table all i see is the table headings. I am trying to create the mobs table for editing. Any help would be appreciated..
07/02/2012 03:26 ShaiyaHaven#2
If you happen to check this anymore after all this time, just use the SELECT function to grab the info you want:
Code:
SELECT * FROM PS_[COLOR="Red"]DatabaseName[/COLOR].dbo.[COLOR="red"]TableName[/COLOR]
Fill in the DatabaseName and TableName parts with the real DB and Table names, obviously; like PS_GameData.dbo.Chars, or PS_GameDefs.dbo.Mobs, etc.

Before the next step, make sure you have SQL set to save the headers of the table, if you need them (if not, skip this). If this is for ShStudio, you will indeed have to do this. You'll find the option here:

SQL Management Studio Tools menu > Options > Query Results > SQL Server > Results to Grid > check box for "Include column headers when copying or saving the results" > Ok


You may want to restart Management Studio to make sure those changes take effect, in which case you will need to run the SELECT query again before moving on. Then, click on the top left square of the results window, the one that highlights the entire results grid. Right click, Save Results As... The save window pops up. Just make sure the file type is CSV, and you're good to go.

If this is specifically for making a Monster.EX for ShStudio, it goes a little further. Type the name of the file (Mobs or MobItems). Instead of just hitting the "Save" button, click the tiny black arrow next to it and select "Save with encoding". Change the dropdown option to ANSI, then hit OK and it should save. Then open the Monster.Sdata and File > Import, import BOTH files before saving, then save. A Monster.EX should have been generated.

Good luck to you on your journey!
07/06/2012 16:10 Follow001#3
Haven, some Error give. me make Step-by-step but Don't Work.

Error :
07/06/2012 21:48 ShaiyaHaven#4
Quote:
Originally Posted by ShaiyaHaven View Post
If this is specifically for making a Monster.EX for ShStudio, it goes a little further. Type the name of the file (Mobs or MobItems). Instead of just hitting the "Save" button, click the tiny black arrow next to it and select "Save with encoding". Change the dropdown option to ANSI, then hit OK and it should save. Then open the Monster.Sdata and File > Import, import BOTH files before saving, then save. A Monster.EX should have been generated.
Pay more attention. :P This will solve your problem.
08/30/2012 19:33 Dread123#5
i did that exactly to the dot but i get the error must start with rowID. yes my headers are selected. but still same issue.
08/31/2012 02:12 liston28727#6
Make sure your query is requesting the "RowID" header. Had that problem before.
09/22/2012 23:08 alekiu#7
I have the same problem