Thursday, February 9, 2023

How to delete Temp dB files when you get error The file cannot be removed because it is not empty.

USE [tempdb] GO ALTER DATABASE [tempdb] REMOVE FILE [temp6] GO Msg 5042, Level 16, State 1, Line 13 The file 'temp6' cannot be removed because it is not empty. USE [tempdb] GO ALTER DATABASE [tempdb] REMOVE FILE [temp6] GO that should help if not --DBCC FREEPROCCACHE('ALL') but test in test environments before doing in production

No comments:

Post a Comment

https://blog.sqlauthority.com/2009/06/27/sql-server-fix-error-17892-logon-failed-for-login-due-to-trigger-execution-changed-database-context...