@@ -3,15 +3,15 @@ function ReadHostInput(){
33 $StorageAccountKey0 = Read-Host - Prompt ' Input the storage account key' - AsSecureString
44 $StorageAccountKey1 = [System.Runtime.InteropServices.Marshal ]::SecureStringToBSTR($StorageAccountKey0 )
55 $Script :StorageAccountKey = [System.Runtime.InteropServices.Marshal ]::PtrToStringAuto($StorageAccountKey1 )
6- $ContainerName0 = Read-Host - Prompt ' Input your storage account container name to upload the NYC Taxi dataset to. Only letters (lower case) , numbers, and the dash (-) character are allowed '
6+ $ContainerName0 = Read-Host - Prompt ' Input your storage account container name to upload the NYC Taxi dataset to. Only letters, numbers, and the dash (-) character'
77 $Script :Server = Read-Host - Prompt ' Input the SQL DW server name'
88 $Script :Database = Read-Host - Prompt ' Input the SQL DW database name'
99 $Script :Username = Read-Host - Prompt ' Input the SQL DW user name'
10- $pass0 = Read-Host - Prompt ' Input the password of user name which has the previlige to create the database' - AsSecureString
10+ $pass0 = Read-Host - Prompt ' Input the password of user name which has the previlege to create the database' - AsSecureString
1111 $pass1 = [System.Runtime.InteropServices.Marshal ]::SecureStringToBSTR($pass0 )
1212 $Script :Password = [System.Runtime.InteropServices.Marshal ]::PtrToStringAuto($pass1 )
1313
14- $Script :RandomNumber = Get-Random
14+ $Script :RandomNumber = Get-Random - minimum 100 - maximum 999
1515
1616 $Script :KeyAlias = ' KeyAlias' + ' _' + $RandomNumber
1717 $Script :ContainerName = $ContainerName0 + ' -' + $RandomNumber
@@ -22,9 +22,10 @@ function ReadHostInput(){
2222 $Script :external_nyctaxi_fare = ' external_nyctaxi_fare' + ' _' + $RandomNumber
2323
2424 # Specify your table names
25- $TripTableName0 = Read-Host - Prompt ' Input the NYC Taxi Trip table name, for example nyctaxi_trip_yourname (no dash(-) in table name)'
26- $FareTableName0 = Read-Host - Prompt ' Input the NYC Taxi Fare table name, for example nyctaxi_fare_yourname (no dash(-) in table name)'
27- $SampleTableName0 = Read-Host - Prompt ' Input the NYC Taxi 1% Sample table name, for example nyctaxi_sample_yourname (no dash(-) in table name)'
25+
26+ if (($TripTableName0 = Read-Host " Input the NYC Taxi Trip table name" ) -eq ' ' ){$TripTableName0 = " nyctaxitrip" }else {}
27+ if (($FareTableName0 = Read-Host " Input the NYC Taxi Fare table name" ) -eq ' ' ){$FareTableName0 = " nyctaxifare" }else {}
28+ if (($SampleTableName0 = Read-Host " Input the NYC Taxi Sample table name" ) -eq ' ' ){$SampleTableName0 = " nyctaxisample" }else {}
2829 $Script :TripTableName = $TripTableName0 + ' _' + $RandomNumber
2930 $Script :FareTableName = $FareTableName0 + ' _' + $RandomNumber
3031 $Script :SampleTableName = $SampleTableName0 + ' _' + $RandomNumber
@@ -303,7 +304,7 @@ If (Test-Path $conf_file){
303304}
304305
305306$DestURL = " http://$StorageAccountName .blob.core.windows.net/$ContainerName "
306- Write-Host " DestURL: " $DestURL
307+ # Write-Host "DestURL: " $DestURL
307308# The NYC Taxi dataset on public blob
308309$Source = " http://getgoing.blob.core.windows.net/public/nyctaxidataset"
309310
@@ -372,12 +373,10 @@ try
372373
373374 $SQLCommand = New-Object System.Data.SqlClient.SqlCommand($qa2 , $SQLConnection )
374375 $SQLCommand.CommandTimeout = 0
375- $SQLCommand.ExecuteScalar ()
376376 $qa2_result = $SQLCommand.ExecuteScalar ()
377377
378378 $SQLCommand = New-Object System.Data.SqlClient.SqlCommand($qa3 , $SQLConnection )
379379 $SQLCommand.CommandTimeout = 0
380- $SQLCommand.ExecuteScalar ()
381380 $qa3_result = $SQLCommand.ExecuteScalar ()
382381
383382
404403 (gc ./ SQLDW_Explorations.ipynb).replace(' <password>' , $Password ) | sc ./ SQLDW_Explorations.ipynb
405404 (gc ./ SQLDW_Explorations.ipynb).replace(' <database server>' , ' SQL Server Native Client 11.0' ) | sc ./ SQLDW_Explorations.ipynb
406405
406+ (gc ./ SQLDW_Explorations_Scripts.py).replace(' <nyctaxi_trip>' , $TripTableName ) | sc ./ SQLDW_Explorations_Scripts.py
407+ (gc ./ SQLDW_Explorations_Scripts.py).replace(' <nyctaxi_fare>' , $FareTableName ) | sc ./ SQLDW_Explorations_Scripts.py
408+ (gc ./ SQLDW_Explorations_Scripts.py).replace(' <nyctaxi_sample>' , $SampleTableName ) | sc ./ SQLDW_Explorations_Scripts.py
409+
410+ (gc ./ SQLDW_Explorations_Scripts.py).replace(' <server name>' , $Server ) | sc ./ SQLDW_Explorations_Scripts.py
411+ (gc ./ SQLDW_Explorations_Scripts.py).replace(' <database name>' , $Database ) | sc ./ SQLDW_Explorations_Scripts.py
412+ (gc ./ SQLDW_Explorations_Scripts.py).replace(' <user name>' , $Username ) | sc ./ SQLDW_Explorations_Scripts.py
413+ (gc ./ SQLDW_Explorations_Scripts.py).replace(' <password>' , $Password ) | sc ./ SQLDW_Explorations_Scripts.py
414+ (gc ./ SQLDW_Explorations_Scripts.py).replace(' <database server>' , ' SQL Server Native Client 11.0' ) | sc ./ SQLDW_Explorations_Scripts.py
407415 }
408416 else
409417 {
420428 (gc ./ SQLDW_Explorations.ipynb) -replace ' <database name>' , $Database
421429 (gc ./ SQLDW_Explorations.ipynb) -replace ' <user name>' , $Username
422430 (gc ./ SQLDW_Explorations.ipynb) -replace ' <password>' , $Password
423- (gc ./ SQLDW_Explorations.ipynb) -replace ' <database driver >' , ' SQL Server Native Client 11.0'
431+ (gc ./ SQLDW_Explorations.ipynb) -replace ' <database server >' , ' SQL Server Native Client 11.0'
424432
433+ (gc ./ SQLDW_Explorations_Scripts.py) -replace ' <nyctaxi_trip>' , $TripTableName
434+ (gc ./ SQLDW_Explorations_Scripts.py) -replace ' <nyctaxi_fare>' , $FareTableName
435+ (gc ./ SQLDW_Explorations_Scripts.py) -replace ' <nyctaxi_sample>' , $SampleTableName
436+
437+ (gc ./ SQLDW_Explorations_Scripts.py) -replace ' <server name>' , $Server
438+ (gc ./ SQLDW_Explorations_Scripts.py) -replace ' <database name>' , $Database
439+ (gc ./ SQLDW_Explorations_Scripts.py) -replace ' <user name>' , $Username
440+ (gc ./ SQLDW_Explorations_Scripts.py) -replace ' <password>' , $Password
441+ (gc ./ SQLDW_Explorations_Scripts.py) -replace ' <database server>' , ' SQL Server Native Client 11.0'
425442 }
426443
427444 $end_time = Get-Date
0 commit comments