Hello all,
Running sql 2008 sp1
New to PowerShell. Can someone please check the syntax and tell me if something doesn't look right.
Trying to load a csv file into a table
The csv file is comma delimited and contains double quotes around values that have a comma in them.
$Server = "MyServer"
$Database = "MyDatabase"
$Table = "MyTable"
$ShareUNCPath = "\\MyShareUNCpath\MyTestfile.csv"
$DataImport = Import-Csv -Path $ShareUNCPath
$DataTable = Out-DataTable -$DataImport
Write-DataTable -ServerInstance $Server -Database $Database -TableName $Table -Data $DataTable
Thanks
gv
Sword