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?
- share instance
local system
account - create batch file (or powershell script) desired commands (sqllocaldb start nameofinstance)
- run gpedit.msc, navigate computer configuration->windows settings->scripts (startup/shutdown)
- add script
Comments
Post a Comment