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
sql server management set up
proc and package for simple code
Create blank tag in xml with no single "open and close" tag
Opening files from Windows Explorer is slow
Hyper Terminal v. 6.1 (Build 7600) running on Windows 7 Professional most often closes after clicking on File and then Open-How can I fix this?
How to get query cretaed by the prepare statement in PDO
How to use sed command to remove text before and after desired syntax?
Suspended VLAN
DIV issues in IE
getting a count of records to not include null or empty records