Strange SQL Query Running as .NET SQLClient Data Provider Locking Model Database
Posted on 2015-01-30
I'm having an issue creating new databases on several of our SQL servers (SQL Server 2008 R2 SP1). When I look at Activity Monitor there are several (anywhere from 2 to 9) different processes all running the same SQL statement (SELECT rl.name AS [Name] FROM sys.database_principals AS rl WHERE (rl.type = 'R') ORDER BY [Name] ASC) that is locking the Model database. When I attempt to create a new DB, I get Error: 1807, could not obtain an exclusive lock on the databse 'model'.
These show as coming from Applicaton .Net SqlClient Data Provider and from the hostname of the SQL server. They are all running as my windows domain account as well. I do not have any additional SQL Management Studio sessions open or running any processes against the DB that I know of. I did the initial install of SQL, but none of the service accounts run as my username.
I can manually kill the sessions that are locking, but they start right back up. Sometimes within seconds, and sometimes a few minutes. I can keep killing them off and eventually get a database created, but it's very stange these processes continue to run all day long. They run and drop off and then start up again in varying numers.
Has anyone seen this before, or know how to trace what is generating it?