Skip to content

Instantly share code, notes, and snippets.

@a4099181
Created September 27, 2017 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a4099181/ca668d982f1ebda48b66d10958d3b2f5 to your computer and use it in GitHub Desktop.
Save a4099181/ca668d982f1ebda48b66d10958d3b2f5 to your computer and use it in GitHub Desktop.
Some commands to work with shared SQLLocalDB instance.

Shared SQLLocalDB instance means that a single local instance may be accessed by any other allowed user.

sqllocaldb share <user> <name> <shared-name>

<user> - user name of the owner of the SQLLocalDB instance to share,

<name> - name of the SQLLocalDB instance to share,

<shared-name> - name of the shared SQLLocalDB instance.

Access to local SQLLocalDB instance is made using (localdb)\<name> as data source in connection string.

Access to shared SQLLocalDB instance is made using (localdb)\.\<shared-name> as data source in connection string.

The last thing to do is to create login with valid role for the user.

create login [<domain>\<user>] from windows;
exec sp_addsrvrolemember N'<domain>\<user>', sysadmin

After that user should be able to access shared SQLLocalDB instace with integrated authentication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment