Last active
August 30, 2018 05:59
-
-
Save flakey-bit/87ec2eaae045d14db77611674aaa1fa9 to your computer and use it in GitHub Desktop.
PowerShell script to load Jurisdiction data into GNAF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[string]$serverName, | |
[string]$databaseName, | |
[string]$jurisdictionFilesPath, | |
[string]$jurisdictionName | |
) | |
$filter = $jurisdictionName+"_*.psv" | |
Get-ChildItem $jurisdictionFilesPath -Filter $filter | | |
Foreach-Object { | |
$tableName = $_.name.Replace($jurisdictionName+"_", "").Replace("_psv.psv", "") | |
write-host "Procesing" $_.Name "into table" $tableName | |
bcp $tableName in $_.FullName -d $databaseName -S $serverName -t"|" -c -T -F 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment