I am trying to extract data from some of my tables using sqlcmd utility as SSMS does not generate appropriate csv-s for me.
My issue: all csv extract includes trailing spaces according to table definitions (I mean field length) regardless of using char, varchar, nvarchar, etc...
When using sqlcmd utility eg with following options:
sqlcmd -S . -d /*databasename*/ -E -s, -W -Q "SELECT * FROM /*tablename*/" > C:\Test.csv
it is still contains trailing spaces, eg:
,"273 ",
any hints or tips to do this in SSMS and/or correcting my parameters for SQLCMD?
char(n)
which will contain fixed length, blank padded values.