Skip to content

Commit b8e2e44

Browse files
authored
Adding parameter -d to sqlcmd
Adding parameter `-d "$DbName"` so the script does not need to include `USE` command. If source database has a different name `USE` command will fail and objects will be created in master.
1 parent a92db69 commit b8e2e44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/content/dynamic local db.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ your project (you can place it in the project root too, if you want):
6565
sqlcmd -S "(LocalDB)\MSSQLLocalDB" -i "createdb.sql"
6666
Remove-Item "createdb.sql"
6767
68-
sqlcmd -S "(LocalDB)\MSSQLLocalDB" -i "$DbScript"
68+
sqlcmd -S "(LocalDB)\MSSQLLocalDB" -i "$DbScript" -d "$DbName"
6969
7070
$detach_db_sql | Out-File "detachdb.sql"
7171
sqlcmd -S "(LocalDB)\MSSQLLocalDB" -i "detachdb.sql"

0 commit comments

Comments
 (0)