diff --git a/Misc/RSQL/RunSQL_SQL_Walkthrough.ps1 b/Misc/RSQL/RunSQL_SQL_Walkthrough.ps1 index 4ccea46d..24dc8e19 100644 --- a/Misc/RSQL/RunSQL_SQL_Walkthrough.ps1 +++ b/Misc/RSQL/RunSQL_SQL_Walkthrough.ps1 @@ -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 {