Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1139337%22%20slang%3D%22en-US%22%3EThe%20session%20limit%20for%20the%20database%20is%20640%20and%20has%20been%20reached%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1139337%22%20slang%3D%22en-US%22%3E%3CTABLE%20style%3D%22margin-left%3A%2030px%3B%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2285%25%22%3E%3CP%3E%3CSTRONG%3ESymptoms%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Ewhen%20connecting%20to%20Azure%20SQL%20DB%20you%20get%20the%20below%20error%3A%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3EResource%20ID%20%3A%202.%20The%20session%20limit%20for%20the%20database%20is%20%3CSTRONG%3E640%3C%2FSTRONG%3E%20and%20has%20been%20reached.%20See%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E'%3CA%20href%3D%22http%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D267637%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D267637%3C%2FA%3E'%20for%20assistance.%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3EMore%20information%20about%20error%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Ftroubleshoot-connectivity-issues-microsoft-azure-sql-database%23error-10928-resource-id-d%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EError%2010928%3A%20Resource%20ID%3A%20%25d%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EResolution%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Ethe%20mitigation%20for%20this%20issue%20is%20to%20make%20sure%20the%20application%20create%20the%20connection%20with%20the%20user%20database%20instead%20of%20the%20master%20database.%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Eyou%20may%20check%20session%20limit%20for%20your%20current%20service%20tier%20in%20the%20docs%20page%3A%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-dtu-resource-limits-single-databases%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EResource%20limits%20for%20Single%20database%20using%20DTU%20model%3C%2FA%3E%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-vcore-resource-limits-single-databases%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EResource%20limits%20for%20Single%20database%20using%20vCore%20model%3C%2FA%3E%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-dtu-resource-limits-elastic-pools%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EResource%20limits%20for%20Elastic%20pool%20database%20using%20DTU%20model%3C%2FA%3E%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-vcore-resource-limits-elastic-pools%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EResource%20limits%20for%20Elastic%20pool%20database%20using%20vCore%20model%3C%2FA%3E%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Eyou%20will%20find%20that%20%3CSTRONG%3E640%3C%2FSTRONG%3E%20limit%20is%20not%20listed%20in%20any%20of%20the%20above%20pages.%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Ethe%20640%20is%20the%20session%20limit%20for%20the%20master%20database%20of%20your%20Azure%20SQL%20Server.%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Egenerally%20speaking%2C%20no%20connection%20should%20be%20created%20with%20the%20master%20database%20as%20in%20master%20nothing%20(almost)%20can%20be%20done.%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3Ealso%20cross%20database%20queries%20are%20not%20supported%20for%20Azure%20SQL%20DB.%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E
Microsoft

Symptoms: 

 

when connecting to Azure SQL DB you get the below error:

Resource ID : 2. The session limit for the database is 640 and has been reached. See

'http://go.microsoft.com/fwlink/?LinkId=267637' for assistance.

 

More information about error: Error 10928: Resource ID: %d

 

Resolution:

 

the mitigation for this issue is to make sure the application create the connection with the user database instead of the master database.

 

you may check session limit for your current service tier in the docs page:

Resource limits for Single database using DTU model

Resource limits for Single database using vCore model

Resource limits for Elastic pool database using DTU model

Resource limits for Elastic pool database using vCore model

 

you will find that 640 limit is not listed in any of the above pages. 

the 640 is the session limit for the master database of your Azure SQL Server. 

generally speaking, no connection should be created with the master database as in master nothing (almost) can be done. 

also cross database queries are not supported for Azure SQL DB.