About 240,000 results
Open links in new tab
  1. Export table to file with column headers (column names) using the …

    Aug 31, 2009 · This method automatically outputs column names with your row data using BCP.. The script writes one file for the column headers (read from INFORMATION_SCHEMA.COLUMNS table) then appends another file with the table data.

  2. sql server - Can I specify an input sql file with bcp ... - Stack Overflow

    May 13, 2012 · As far as I'm concerned the BCP utility only supports Transact-SQL queries directly written to the command line. Ex: bcp "SELECT Name FROM AdventureWorks.Sales.Currency" queryout Currency.Name.dat -T …

  3. sql server - Running a SQL Query using BCP - Stack Overflow

    May 28, 2024 · I just started learning to use SQL Server's BCP and I'm using it to query a SQL Server DB and create a .csv file. I can create the file with no problem using this command: bcp "SELECT 'ID' FROM [database].[dbo].[table]" queryout C:\DeskTop\test.csv -c -t, -T -S However, I need to run a more advance query and I'm have problems.

  4. How to write using BCP to a remote SQL Server? - Stack Overflow

    Mar 9, 2017 · -S server_name [\instance_name] Specifies the instance of SQL Server to which to connect. If no server is specified, the bcp utility connects to the default instance of SQL Server on the local computer. This option is required when a bcp command is run from a remote computer on the network or a local named instance.

  5. sql server - Improve speed of BCP - command line options

    May 8, 2012 · So it's really just a special lock for BCP. To further increase performance, you may read further into the -a flag on the BCP parameters page.-a allows to to specify a larger packet size (between 4096 and 65535) to increase the amount …

  6. sql server - bcp command not working - Stack Overflow

    Mar 27, 2013 · BCP is for the C prompt not for SQL Server Management Studio. To run it inside SSMS you need to use xp_cmdshell (and be logged as a user with rights to get to xp_cmdshell). Share

  7. sql server - Insert rows with Unicode characters using BCP - Stack …

    Jan 6, 2017 · If you are using BCP that came with SQL Server 2016 (version 13.0) or newer, then you can simply add -c -C 65001 to the command line. -C is for "code page", and 65001 is the code page for UTF-8. The MSDN page for bcp Utility states (in the explanation of the -C switch):

  8. How to run a .sql file using bcp in SQL Server - Stack Overflow

    Aug 13, 2018 · @UdItSolanki, the BCP command does not seem to be recognising the sql in the input file. It only accepts a direct sql string. -i is for input file, which is basically an interface file for interactive BCP usage, You can put sequential responses in this file. Not the SQL. –

  9. sql server - Where Is Microsoft Command Line Utilities 16

    Mar 9, 2023 · SQL Server 2022's installer will direct you to this link to install the command line utilities which get you bcp and sqlcmd. Which provides the SQL Server Tools link. Which gives you a link for bcp and sqlcmd. They both give you the same Download Microsoft Command Line Utilities 15 for SQL Server (x64) (2.6 MB) download link. The Problem

  10. using BCP to export stored procedure result in SQL Server 2008

    Jun 19, 2012 · Then you can have another generic stored procedure or function to create and execute full BCP command with that statement embedded. I am pretty sure that in this case BCP might use a lot better execution plan. Unfortunately, I cannot verify that in practice, because of BCP bug in SQL Server 2008 R2 I mentioned in my previous post. N.B.

Refresh