title: SQL assign read/write access to all users on PC
body: <p>I'm installing an SQL database and our application on a single PC. Under Vista this needs to be installed by an administrator account, but this means that the regular user account(s) can run our program, but it can't access the database it needs.</p>
  
  <p>What I need is a simple way of allowing all NT logins on the PC to have access to the database.</p>
  
  <p>I thought I'd solved it: In SSMS I can manually assign db_datareader/writer roles to BUILTIN\Users, and it works perfectly.</p>
  
  <p>However, if my installer programmatically executes the following, it doesn't work:</p>
  
  <pre><code>USE [OurDatabase]
  GO
  EXEC sp_addrolemember N'db_datawriter', N'BUILTIN\Users'
  GO
  EXEC sp_addrolemember N'db_datareader', N'BUILTIN\Users'
  GO
  </code></pre>
  
  <p>The users get assigned the roles, but they still can't access the database. The only difference I can see in SSMSE is that in the latter case, they also gain ownership of a new "BUILTIN\Users" schema, which I suspect may be screwing things up. Clearly SSMS does something slightly different...</p>
  
  <p>Can anyone suggest a way to get this working programmatically?</p>