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