dataplat / web

dbatools.io website
1 stars 6 forks source link

Write-DbaDbTableData not working #48

Closed centeiol closed 1 year ago

centeiol commented 1 year ago

Hi

$data | Write-DbaDbTableData -SqlInstance $serverName -Database $databaseName -Schema dbo -Verbose -Table $tableName -AutoCreateTable

give me Error occurred while establishing connection to localhost\SQLEXPRESS | The certificate chain was issued by an authority that is not trusted

but for example Invoke-Sqlcmd -ServerInstance OMX-LPT-0107\SQLEXPRESS -Query "select * from sys.databases" is OK

I read somewhere that I could put TrustServerCertificate=True in connectio string, but where in Write-DbaDbTableData ?

How can I overcome this issue?

jpomfret commented 1 year ago

Hi there, Check out this blog post that talks through the new defaults for SMO and how to get around that error: https://dbatools.io/newdefaults