PowerShell-将CSV导入SQL Server
$database = 'foxdeploy' $server = '.' $table = 'dbo.powershell_test' Import-CSV .\yourcsv.csv | ForEach-Object {Invoke-Sqlcmd ` -Database $database -ServerInstance $server ` -Query "insert into $table VALUES ('$($_.Column1)','$($_.Column2)')" }