Core component of SQL Server for storing, processing, and securing data
AFAIK, the -u option in the bcp tool is available starting with bcp version 18 and later. If you're using version 16.0.1000.6, which is from the ODBC\170\Tools\Binn folder, this version of bcp does not support the -u option, although it does support -G for Microsoft Entra authentication. The absence of the -u option in this version is the main issue you're encountering.
To get a version of bcp that supports both -G (for Entra authentication) and -u (for trusting the server certificate when encryption is enabled), you need to install the Microsoft Command Line Utilities 15 for SQL Server, which includes a compatible build of bcp that supports both options.
To proceed, install the latest Microsoft Command Line Utilities 15 for SQL Server, ensuring you have the version that includes the updated bcp. You can download the appropriate version for your architecture:
- x64: Microsoft Command Line Utilities 15 for SQL Server (x64)
- x86: Microsoft Command Line Utilities 15 for SQL Server (x86)
Additionally, make sure you have the latest Microsoft ODBC Driver 17 for SQL Server installed - this is a prerequisite for these tools. This should ensure full compatibility for both the authentication (-G) and encryption handling (-u).
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin