Search notes:

SqlLocalDB.exe

SqlLocalDB.exe is the SQL Server Express LocalDB Command Line Tool.

Operations

Operations that can be executed with SqlLocalDB.exe have a short and long form. They have no hyphen or slash prefix.

Show all existing LocalDB instances

The info operation shows all LocalDB instances that are either
  • owned by the current user or
  • shared
SqlLocalDB info
The short form for this operation is i.
info|i Lists all existing LocalDB instances owned by the current user and all shared LocalDB instances.

Create a new instance

SqlLocalDB create "new instance name"
SqlLocalDB create "new instance name" version-number
SqlLocalDB create "new instance name" version-number -s
With -s, the LocalDB instance is started after it has been created
If the optional version number is omitted, it will default to the latest installed version on the system.
Short form d.

Start an instance

SqlLocalDB start
SqlLocalDB start "instance name"
Short form: s

Stop an instance

SqlLocalDB stop
SqlLocalDB stop "instance name"
SqlLocalDB stop -i
SqlLocalDB stop -k
With -i, the instance is shutdwon with the NOWAIT` option.
With -k, the LocalDB instance process is killed without contacting it.
Short form: p

Share a (private) instance

SqlLocalDB share "private name" "shared name"
SqlLocalDB share "SID of owner" "private name" "shared name"
SqlLocalDB share "account name" "private name" "shared name"
If SID or account name is omitted, it defaults to the current user.
Short form: h

Unshare instance

SqlLocalDB unshare "shared name"
Short form: u

Delete an instance

SqlLocalDB delete
SqlLocalDB delete "instance name"
Short form: d

Show Versions

Show all versrions that are installed on a computer.
SqlLocalDB versions
Short form: v

Turn tracing on or off

SqlLocalDB trace on
SqlLocalDB trace off
Short form: t

See also

SQL Server editions

Index