Home
%3CLINGO-SUB%20id%3D%22lingo-sub-369152%22%20slang%3D%22en-US%22%3ELesson%20Learned%20%2354%3A%20The%20specified%20schema%20name%20name%40domain.com%20either%20does%20not%20exist%20or%20you%20do%20not%20have%20permission%20to%20use%20it%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-369152%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Jan%2013%2C%202019%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20Hello%20Team%2C%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Some%20days%20ago%2C%20I%20worked%20in%20a%20very%20interesting%26nbsp%3Bservice%20request.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Our%20customer%20created%20a%20Azure%20Active%20Directory%26nbsp%3Bgroup%20adding%20two%20members%20and%20they%20added%20this%20group%20as%20db_owner%20role%20of%20the%20database.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20The%20first%20member%20of%20this%20group%20is%20able%20to%20create%20tables%20without%20problems%20%26nbsp%3Busing%20%3CSTRONG%3E%20CREATE%20TABLE%20TableExample%20(id%20int)%20%3C%2FSTRONG%3E%20but%20the%20second%20or%20others%20ones%20are%20not%20able%20and%20they%20are%20facing%20the%20following%20error%3A%20%3CSTRONG%3E%20Msg%202760%2C%20Level%2016%2C%20State%201%2C%20Line%201%20%5BThe%20specified%20schema%20name%20name%40domain.com%20either%20does%20not%20exist%20or%20you%20do%20not%20have%20permission%20to%20use%20it.%5D%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20It%20seems%20that%20starting%20the%20second%20member%20of%20the%20group%2C%20the%20default%20schema%20that%20SQL%20Engine%20is%20using%20is%20the%20user%20account%20not%20dbo.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20In%20order%20to%20mitigate%20the%20issue%2C%20we%20have%20two%20solutions%3A%20%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3E%3CSTRONG%3ESpecify%20the%20schema%20name%20in%20the%20name%20of%20the%20table%20%3C%2FSTRONG%3E%20%2C%20like%20this%20one%3A%20%3CSTRONG%3E%20CREATE%20TABLE%20dbo.TableExample%20(id%20int)%20%3C%2FSTRONG%3E%20every%20member%20of%20the%20group%20are%20able%20to%20without%20problem.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CSTRONG%3ESpecify%20the%20schema%20default%20name%20%3C%2FSTRONG%3E%20at%20the%20moment%20of%20the%20creation%20of%20the%20group%20using%20the%20default_schema%20option.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20Enjoy!%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-369152%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Jan%2013%2C%202019%20Hello%20Team%2CSome%20days%20ago%2C%20I%20worked%20in%20a%20very%20interesting%26nbsp%3Bservice%20request.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-369152%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2760%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ethe%20specified%20schema%20name%20namedomain%20com%20either%20does%20not%20exist%20or%20you%20do%20not%20have%20permission%20to%20use%20it%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
First published on MSDN on Jan 13, 2019
Hello Team,

Some days ago, I worked in a very interesting service request.

Our customer created a Azure Active Directory group adding two members and they added this group as db_owner role of the database.

The first member of this group is able to create tables without problems  using CREATE TABLE TableExample (id int) but the second or others ones are not able and they are facing the following error: Msg 2760, Level 16, State 1, Line 1 [The specified schema name name@domain.com either does not exist or you do not have permission to use it.]

It seems that starting the second member of the group, the default schema that SQL Engine is using is the user account not dbo.

In order to mitigate the issue, we have two solutions:

  • Specify the schema name in the name of the table , like this one: CREATE TABLE dbo.TableExample (id int) every member of the group are able to without problem.

  • Specify the schema default name at the moment of the creation of the group using the default_schema option.


Enjoy!