title: Set default database to user SQL Server (Azure)
body: <p>I'm trying to create a database user from C# in Azure SQL Server. But I need to set its default database (<code>DEFAULT_DATABASE</code>) but the script doesn't work on Azure.</p>
  
  <p>Does anyone know how can I do it?</p>
  
  <pre><code>CREATE USER newlogin FOR LOGIN newlogin;
  ALTER LOGIN newlogin WITH DEFAULT_DATABASE = myDatabase;
  </code></pre>
  
  <p>but it throws an error:</p>
  
  <blockquote>
    <p>Keyword or statement option 'default_database' is not supported in this version of SQL Server.</p>
  </blockquote>
  
  <p>After I created the user and try to connect to SQL Server, this error occurs:</p>
  
  <p><a href="https://i.stack.imgur.com/2qtfq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2qtfq.png" alt="enter image description here"></a></p>