sql server - LocalDb - starting a shared instance as other user -


i using sql server 2012 localdb instance shared users. have created sql server login can used users. commands using (executing 'administrator'):

sqllocaldb.exe create test sqllocaldb.exe share test testshared sqllocaldb.exe stop test sqllocaldb.exe start test  // sql commands create login {0} password = '{1}' exec master..sp_addsrvrolemember @loginame = '{0}', @rolename = 'sysadmin' 

but when performing system restart, seems the instance not started automatically. connecting instance 'user' brings following error:

a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 40

performing "sqllocaldb start .\testshared " non-owner of database instance not help, need execute statement owner (which of course not available upon each restart).

how can configure localdb instance accessible users when computer restarted?

  1. share instance local system account
  2. create batch file (or powershell script) desired commands (sqllocaldb start nameofinstance)
  3. run gpedit.msc, navigate computer configuration->windows settings->scripts (startup/shutdown)
  4. add script

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -