May 26, 2013 at 9:51 pm
Hi,
could any one pls help me ? am scratching my head with sqlcmd.
this the issue
create table testcmd (a int identity, b varchar(10))
go
insert into testcmd values ('a,b,c')
running below sqlcmd
sqlcmd -SMyservername -E -q"select b from testcmd" >"files.csv" -s"," -W -w200
Column B has comma separated value, so in csv, it breaks upto three column.s how to do this for -s?
May 27, 2013 at 12:01 am
No worries. it seems worked when my developer to go for txt instead of csv.
May 27, 2013 at 1:01 am
SQLCMD -S YourSQLServer -d YourDatabase -U YourUserName -P YourPassword -Q "Your Query" -s "," -o "C:\Yourfilename.csv"
May 29, 2013 at 4:50 am
Thanks.. It worked when I used -o instead of >.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy