Abdu Rafeeq

Abdu Rafeeq

  • NA
  • 113
  • 264.7k

Reduce ldf file size

Apr 4 2011 3:13 AM

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)