Skip to content

Commit f2fed3c

Browse files
committed
Minor formatting fixes.
1 parent 9fbce72 commit f2fed3c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

docs/t-sql/statements/alter-database-transact-sql.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -885,13 +885,13 @@ The plan cache is also flushed when several queries are executed against a datab
885885

886886
- Some `ALTER DATABASE` statements require exclusive lock on a database to be executed. This is why they might fail when another active proces is holding a lock on the database. Error that is reported in a case like this is `Msg 5061, Level 16, State 1, Line 38` with message `ALTER DATABASE failed because a lock could not be placed on database '<database name>'. Try again later`. This is typically a transient failure and to resolve it, once all locks on the database are released, retry the ALTER DATABASE statement that failed. System view `sys.dm_tran_locks` holds information on active locks. To check if there are shared or exclusive locks on a database use following query.
887887
```sql
888-
SELECT
889-
resource_type, resource_database_id, request_mode, request_type, request_status, request_session_id
890-
FROM
891-
sys.dm_tran_locks
892-
WHERE
893-
resource_database_id = DB_ID('testdb')
894-
```
888+
SELECT
889+
resource_type, resource_database_id, request_mode, request_type, request_status, request_session_id
890+
FROM
891+
sys.dm_tran_locks
892+
WHERE
893+
resource_database_id = DB_ID('testdb')
894+
```
895895

896896
## Viewing Database Information
897897

0 commit comments

Comments
 (0)