We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Was not possible to set the parameter -u that permit Trust server certificate. (available since bcp version 18).
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/connecting-with-bcp?view=sql-server-ver16
I did the modification below and works:
def bcp(sql_table, flat_file, batch_size): """Runs the bcp command to transfer the input flat file to the input SQL Server table. :param sql_table: The destination Sql Server table :type sql_table: SqlTable :param flat_file: Source flat file :type flat_file: FlatFile :param batch_size: Batch size (chunk size) to send to SQL Server :type batch_size: int """ if sql_table.with_krb_auth: auth = ['-T'] else: auth = ['-U', sql_table.username , '-P', sql_table.password ] full_table_string = f'{sql_table.database}.{sql_table.schema}.{sql_table.table}' try: bcp_command = ['bcp', full_table_string, 'IN', flat_file.path, '-f', flat_file.get_format_file_path(), '-S', sql_table.server, '-b', str(batch_size), '-u'] + auth
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Was not possible to set the parameter -u that permit Trust server certificate. (available since bcp version 18).
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/connecting-with-bcp?view=sql-server-ver16
I did the modification below and works:
def bcp(sql_table, flat_file, batch_size):
"""Runs the bcp command to transfer the input flat file to the input
SQL Server table.
:param sql_table: The destination Sql Server table
:type sql_table: SqlTable
:param flat_file: Source flat file
:type flat_file: FlatFile
:param batch_size: Batch size (chunk size) to send to SQL Server
:type batch_size: int
"""
if sql_table.with_krb_auth:
auth = ['-T']
else:
auth = ['-U', sql_table.username , '-P', sql_table.password ]
full_table_string =
f'{sql_table.database}.{sql_table.schema}.{sql_table.table}'
try:
bcp_command = ['bcp', full_table_string, 'IN', flat_file.path, '-f',
flat_file.get_format_file_path(), '-S',
sql_table.server, '-b', str(batch_size), '-u'] + auth
The text was updated successfully, but these errors were encountered: