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
Load XML file into sqlserver 2008 Database using c#
asp.net. why am i geting this error: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path
Exchange 2007 bouncing a message
Windows Server 2008 RS Remote Desktop Service Long Logoff time
Cannot check POP mail in Outlook 2007
ClientScript.RegisterStart
upScript not working
Background Image Not Showing
What causes new Windows 7 computer to have expired activation?
100% CPU usage by Internet Explorer and wayward msiexec.exe
backup file maintenance / cleanup.