I would like to export a table selecting only certain fields using a query rather than using the export wizard – as once my query is written, I only have to hit run everytime,
saving me time.
I have written the script of the variables I want (see below). but need to know if there is anything I can add to the script to be able to create a csv table from it
by just clicking run once.
distinct [Customer Ref No]
[Customer Ref No],
Did you try this code:
SQLCMD -S MyInstance -E -d dbname -i query_file.sql -o output_file.csv -s ,
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?