title: Why is dotnet ef not able to create a database against SQL Server Express?
body: <p>I have gone through this ASP.Net MVC Core tutorial at:
  <a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/working-with-sql" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/working-with-sql</a>.
  And I am able to use dotnet migrations to create the database against the localDb with this connection string in the appsettings.json file:</p>
  
  <pre><code>{
    "ConnectionStrings": {
  "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-MvcMovie-3005e0f3-42f4-4163-94cc-f794a05e8b91;Trusted_Connection=True;MultipleActiveResultSets=true"
    }
  </code></pre>
  
  <p>Now I want to point it to SQL Server Express to see if I can work from there and SSMS.</p>
  
  <p>So now I use this in the appsettings.json file:</p>
  
  <pre><code>{
    "ConnectionStrings": {
     "SqlExpressConnection": "Server=.\\SQLEXPRESS;Database=MvcMovieDb1;Integrated Security=True;MultipleActiveResultSets=true"
    }
  </code></pre>
  
  <p>And in StartUp.ConfigureServices(), change:</p>
  
  <pre><code>services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
              options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
  </code></pre>
  
  <p>to</p>
  
  <pre><code>services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
              options.UseSqlServer(Configuration.GetConnectionString("SqlExpressConnection")));
  </code></pre>
  
  <p>Then in the command prompt run:</p>
  
  <blockquote>
    <p>dotnet ef database update</p>
  </blockquote>
  
  <p>But now I get:
  "CREATE DATABASE permission denied in database 'master'.</p>
  
  <p>How can I give ef permission to create the database?
  Is there a login/password parameter that the dotnet ef can use if I create a login with CREATE Permissions?</p>
  
  <hr>
  
  <p>Well it seems I don't have DB permissions like I thought.  </p>
  
  <p>I just did a test to add a db from within SSMS and I don't seem to have CREATE privilege
  "CREATE DATABASE Permission denied in database 'master'.</p>
  
  <p>I am in SSMS under my computer admin login account.
  And I startup SSMS using windows authentication.
  So the top connection node looks like:
  FullComputerName\SQLExpress(SQL Server 11.0.6020 - CompanyDomainName\Samuel).</p>
  
  <p>The Windows Authentication login is in the form: CompanyDomainName\Samuel.
  I don't see my CompanyDomainName\Samuel account under Computer Manager - Users.
  Not sure how I am able to login to the computer with this account.
  How can I add this account as a login under Security Logins?</p>