We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a9408f9 + e04c671 commit 0c048e0Copy full SHA for 0c048e0
ExecuteSqlInteractive.ps1
@@ -35,6 +35,11 @@ Make sure ExecuteSql.ps1 exists in the same directory
35
. ".\RunSql.ps1"
36
37
$inputSqlFile = read-host "Enter the SQL file name"
38
+if (-Not ($inputSqlFile -Like "*.sql"))
39
+{
40
+ Write-Host "Please enter a sql file."
41
+ return
42
+}
43
$SqlServerInstance = read-host "Enter the SqlServer Intance"
44
$DbName = read-host "Enter the Database name"
45
$useWindowsAuth = read-host "Do you want to use Windows Authentication, y or n?"
@@ -57,4 +62,4 @@ if($useWindowsAuth) {
57
62
else
58
63
{
59
64
RunSql $inputSqlFile $SqluserName $Sqlpwd $DbName $SqlServerInstance $outputFile
60
-}
65
0 commit comments