2
Answers

Reduce ldf file size

Ask a question
Abdu Rafeeq

Abdu Rafeeq

13y
2.8k
1

I tried to reduce size of ldf file with the code



alter

@Dbname nvarchar(1000)

BEGIN

DECLARE

@qry nvarchar(4000)

SET

@qry='dbcc shrinkfile('+@Dbname+'_Log,TRUNCATEONLY) '

exec

(@qry)

END




but  i got error

"

Cannot perform a shrinkfile operation inside a user transaction. Terminate the transaction and reissue the statement."


how possible?

As

procedure reduceDatabaseSize

Answers (2)