title: SQL Server domain name and user name formatting
body: <p>I am executing a SQL script in SQL Server Management Studio 2018. In my script I need to specify a user (including the domain - unsure if I need the server name).</p>
  
  <p>So I have created a user <code>sam</code>, set the user type to <code>SQL user without login</code> and set the users role to <code>db_datareader</code> and <code>db_datawriter</code>. </p>
  
  <p>I then execute my script but it gives me the error: <code>User or role 'MHT.sam' does not exist in this database.</code></p>
  
  <p>But I am almost certain I have added this user to the database (see my images below to double check). <strong>Is my user and domain name format correct?</strong> What do you think I am doing wrong?</p>
  
  <p><a href="https://i.stack.imgur.com/CY2gS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CY2gS.jpg" alt="enter image description here"></a></p>
  
  <p>Here's my domain and server:<br>
  <a href="https://i.stack.imgur.com/hwJoQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hwJoQ.jpg" alt="enter image description here"></a></p>