Sample Header Ad - 728x90

Shared connection pool in SQL Server and prevention of cross-database queries

4 votes
2 answers
3582 views
Microsoft recommends that a shared connection pool should be used when running e.g. a SaaS software with one database per customer but with a shared codebase to prevent pool fragmentation. When taking out a connection from the pool the database to access should be first be changed by the command USE Database_A. However, as I see it, all the databases would then use the same login with let's say the db_datareader role, right? Is there any easy way to prevent the user from making cross-database queries or directly querying other databases using a syntax like SELECT * FROM Database_B.dbo.Person?
Asked by brunnsbe (61 rep)
May 20, 2015, 01:30 PM
Last activity: Mar 14, 2024, 11:42 AM