0
votes

I'm trying to use Entity Framework code first with local IIS and SQL Server 14. When I start my app I get an error

CREATE DATABASE permission denied in database 'master'

I'm using integrated security and can create database from this user manually.

Here is my connection string:

<add name="MyConn" 
     connectionString="Data Source=Server_instance_name;Initial Catalog=db_name;Integrated Security=True;" 
     providerName="System.Data.SqlClient"/>

Actually the user has permission to create database (dbcreator role is assigned to user).

1

1 Answers

1
votes

You must to do it in two steps :

  • Identify who is really connected with Integrated Security. It can be the user in the IIS Application Pool or it can be the user authenticated in somes cases (Negociate). Integrated Security is a little bit confusing in some case with IIS App.
  • Add identified user with correct right in SQL Server.

With your description, it's probably you're not using user you think.