Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

Share a database with LocalDB

$
0
0

Hi all,

Reading the "permissions" part of this page I understand that I can share a database with several users even if those users do not use a shared instance.

To do that, I just need to create the database in a folder that is available for the 2 users.

I've tried:

User 1:

  • Connect (LocalDB)\v11.0 (with SQLCMD)
  • create database MyDB on (name='MyDB', filename='c:\ProgramData\MyCompany\MyDB.mdf');
  • Disconnect

User 2:

  • Connect (LocalDB)\v11.0 (with SQLCMD)
  • use MyDB
  • --> Database 'MyDB' does not exist.

I suppose I must "attach" MyDB to the file in the User 2 context but I don't know how to accomplish that.

Regards,

Tetranos


Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>