DB1にExcelファイルをインポートしようとすると、以下の電源シェルコードがあります。SQL Server 2012にファイルをインポートするときにエラーが発生する
$dir = "\\server\folder\"
$latest = Get-ChildItem -Path $dir | Where-Object {$_.name -like "*Notes*"} | Sort-Object LastWriteTime -Descending | Select-Object -First 1
Write-Output "The latest file is: $latest"
Write-SqlTableData -ServerInstance "instance1" -DatabaseName "DB1" -SchemaName dbo -TableName Table1 -InputData $latest -Force
私はこのコードを実行するとエラーになっアムは、以下を参照してください:私はこのエラーをGoogleで検索していると、任意の助けを得るように見えることはありません
Write-SqlTableData : A mapping between .Net type 'System.IO.DirectoryInfo' and SQL type for column 'Directory' was not found. Consider removing the column with that type and repeat the operation
。私を助けてくれる人は誰ですか?