The following lines are working fine and exporting as CSV. I want all the comma-separated values in double-quotes. I want to export the results of SELECT * FROM [AbcSQL].[dbo].[Customer] WHERE...
into CSV with all output values in "123" this format
BEGIN
Declare @custid as int
Declare @qry as varchar(8000)
Declare @cmd varchar(8000)
set @trcustomerid = 1234
set @qry = 'set nocount on; SELECT * FROM [AbcSQL].[dbo].[Customer] WHERE trcustomerid= ' + cast(@custid as nvarchar(10)) + ''
SET @cmd = 'sqlcmd -s, -S serverdetails, -W -Q "' + @qry + '" | findstr /v /c:"-" /b > "c:\Data\trCustomer.csv"'
EXEC master..xp_cmdshell @cmd
END