September 28, 2016 at 10:38 am
Comments posted to this topic are about the item SQLCMD to export data in txt file
Sheraz Mirza::hehe:
October 12, 2016 at 12:03 am
Hi Sheraz.Mirza,
Very interesting script this. Tell me is there a way to output this in comma delimited format without having to concatenate the fields?
Manie Verster
Developer
Johannesburg
South Africa
I am happy because I choose to be happy.
I just love my job!!!
October 12, 2016 at 7:00 am
Haven't really used it this way before. Thanks for the short lesson.
October 12, 2016 at 7:35 am
You can use the lowercase s option from the command-line (-s",") or the SQLCMDCOLSEP variable (set SQLCMDCOLSEP=,)
You need to be careful how you specify options in .BAT/.CMD because comma can used to separate commands.
October 17, 2016 at 7:10 am
Boss, a very simple and easy way for comma seperated value is, just put file extension as (.csv) , and it will generate microsoft excel comma seperated file
Sheraz Mirza::hehe:
October 17, 2016 at 7:24 am
Sheraz.Mirza (10/17/2016)
Boss, a very simple and easy way for comma seperated value is, just put file extension as (.csv) , and it will generate microsoft excel comma seperated file
Nope, I tried that and it did not work. Put everything in one column but thanks anyway.
Manie Verster
Developer
Johannesburg
South Africa
I am happy because I choose to be happy.
I just love my job!!!
October 17, 2016 at 8:51 am
I tried it again on command prompt , and its working
Sheraz Mirza::hehe:
October 20, 2016 at 6:16 am
Very weird result. I have text all over the place in the textfile when it's a from a table I recently made, but it works fine with one of the Adventure Works ones. Tried making a brand new one and again it puts a lot of spaces where there is none. Dropped it and made it again where all the columns were varchar 10, 15... and up to 30, and then it looked nice. So don't use max in your columns if you use this, or convert it first.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply