I wanted to shrink the log file as much as possible by the command:
DBCC SHRINKFILE ('LogFile', 10)
and get this error:
Cannot shrink log file 2 ('LogFile') because the logical log file located at the end of the file is in use.
I tested these solutions, but my problem isn't solved yet
How can I solve this problem?
SOLVED
I executed this query
SELECT name, database_id, log_reuse_wait, log_reuse_wait_desc FROM sys.databases
Result:
log_reuse_wait_desc: CHECKPOINT
and after execute CHECKPOINT and DBCCSHRINKFILE my problem solved.
I executed this query
SELECT name, database_id, log_reuse_wait, log_reuse_wait_desc FROM sys.databases
Result: log_reuse_wait_desc: CHECKPOINT
and after execute CHECKPOINT and DBCCSHRINKFILE my problem solved.