Encrypt connection when using sqlcmd
0
votes
1
answer
4416
views
Trying to connect database with an encrypted connection, tried below sql queries:
sqlcmd -N -E -S tcp:SQLSERVER,1234 -U username -P password -d Database -Q "INSERT INTO table1 VALUES(1,2,2)
> ERROR: Sqlcmd: The -E and the -U/-P options are mutually exclusive.
-N -S tcp:SQLSERVER,1234 -U username -P password -d Database -Q "INSERT INTO table1 VALUES(1,2,2)
> ERROR Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : SSL Provider: The target principal name is incorrect. Sqlcmd: Error:
> Microsoft ODBC Driver 13 for SQL Server : Client unable to establish
> connection
-S tcp:SQLSERVER,1234 -U username -P password -d Database -Q -E -N "INSERT INTO table1 VALUES(1,2,2)
> Sqlcmd: '-Q': Missing argument. Enter '-?' for help.
Am I missing something here?
Asked by chris
(103 rep)
Feb 28, 2020, 11:12 PM
Last activity: Mar 2, 2020, 01:41 AM
Last activity: Mar 2, 2020, 01:41 AM