Microsoft
Software
Hardware
Network
Question : Can I use a sql query file (.sql) with bcp.exe?
I'm currently using the SQL server tool bcp.exe to export data from my sql database.
I have many queries saved in .sql files and would like to use them with bcp.exe
I'm currently using the following command:
bcp.exe "SELECT * FROM dbase.dbo.items'" queryout "c:\output\output.csv" -c -T -t;
But I would like to use something like:
bcp.exe "my_query.sql" queryout "c:\output\output.csv" -c -T -t;
Does anyone know how to achieve this?
I can't seem to find the correct notation/parameters.
Thanks in advance,
Clyde.
Answer : Can I use a sql query file (.sql) with bcp.exe?
I started using SQLCMD instead.
I could remove the headers with the -h-1 option.
Thanks for the replies anyway!
Random Solutions
Copying a sheet from one file to another without opening either in Excel
setting Oracle session to the right language
ORDER BY items must appear in the select list if the statement contains a UNION operator.
delicious tags and notes to firefox
pattern matching regular expression
avoid the reserved space
Adobe Fireworks CS3 Basic Text Question
VBA to update field values on a table during a loop
site permissions not working for restored sharepoint site
What tool do you use to manage 100+ oracle databases