Skip to content
This repository was archived by the owner on Jun 29, 2019. It is now read-only.

Update RunSQL_SQL_Walkthrough.ps1 #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Misc/RSQL/RunSQL_SQL_Walkthrough.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,16 @@ $db_tb = $dbname + ".dbo.nyctaxi_sample"
Write-host "start loading the data to SQL Server table..." -Foregroundcolor "Yellow"
try
{
bcp $db_tb in $csvfilepath -t ',' -S $server -f taxiimportfmt.xml -F 2 -C "RAW" -b 200000 -U $u -P $p
#The MS SQL Server user and password is specified
if($u -and $p)
{
bcp $db_tb in $csvfilepath -t ',' -S $server -f taxiimportfmt.xml -F 2 -C "RAW" -b 200000 -U $u -P $p
}
#The MS SQL Server user and password is not specified - using the Windows user credentials
else
{
bcp $db_tb in $csvfilepath -t ',' -S $server -f taxiimportfmt.xml -F 2 -C "RAW" -b 200000 -T
}
}
catch
{
Expand Down