jeffwest21
IS-IT--Management
I need to create an export from my SQL 2005 database, i have the following
DECLARE @bcpCommand VARCHAR(8000)
SET @bcpCommand = 'bcp " SELECT * from ##TempExportData2" queryout'
SET @bcpCommand = @bcpCommand + ' ' + @fullFileName + ' -c -T -t"\",\"" -r"\"\n\"" -Usa -Psa '
EXEC Master..xp_cmdshell @bcpCommand
Which quite happily bcp's my data from my table out into a csv file and has quotes and commas in it, the issue is I want to do this without headers.
Is there a way that i can turn the headers off?
'Clever boy...'
DECLARE @bcpCommand VARCHAR(8000)
SET @bcpCommand = 'bcp " SELECT * from ##TempExportData2" queryout'
SET @bcpCommand = @bcpCommand + ' ' + @fullFileName + ' -c -T -t"\",\"" -r"\"\n\"" -Usa -Psa '
EXEC Master..xp_cmdshell @bcpCommand
Which quite happily bcp's my data from my table out into a csv file and has quotes and commas in it, the issue is I want to do this without headers.
Is there a way that i can turn the headers off?
'Clever boy...'