<!DOCTYPE html> <html> <head> </head> <body> <pre>Se si ottiene l'errore seguente in fase di creazione db:<br /><strong>An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)</strong><br /><strong>Could not obtain exclusive lock on database 'model'. Retry the operation later.</strong><br /><strong>CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 1807)</strong><br /><br />.. lanciare il seguente script e se escono righe eseguire <strong>KILL [ID_Session]<br /><br /></strong>Per ulterior info vedi articolo originale:<br /><span style="color: #0000ff;"><em>https://blog.sqlauthority.com/2016/05/25/sql-server-fix-error-1807-not-obtain-exclusive-lock-database-model-retry-operation-later-part-2/</em></span><br /><br />IF EXISTS ( SELECT request_session_id FROM sys.dm_tran_locks WHERE resource_database_id = DB_ID('model') ) BEGIN PRINT 'Model Database in use!!' SELECT * FROM sys.dm_exec_sessions WHERE session_id IN ( SELECT request_session_id FROM sys.dm_tran_locks WHERE resource_database_id = DB_ID('model') ) END ELSE PRINT 'Model Database not in used.' </pre> </body> </html>
Subscribe
0 Comments
Oldest