I'm a beginner at python.Thank you for your cooperation.
\
in the \\
, but input_file=r'C:\xxxx\ImportData\test.csv'
sql=f "usp_test {input_file}"
_cn.execute(sql)
'42000', "[42000] [Microsoft] [ODBC SQL Server Driver] [SQL Server]'\\' Invalid syntax in neighborhood. (102) (SQLExecDirectW)"
I solved myself.
It worked by rewriting to /
instead of \
.
I thought I couldn't use /
.
input_file='C:/xxxx/ImportData/test.csv'
© 2024 OneMinuteCode. All rights reserved.