CREATE Procedure sp_mrx_truncatelog
AS
declare db cursor LOCAL for SELECT NAME FROM sysdatabases
declare @dbname varchar(200),@sql varchar(2000)
OPEN db
FETCH NEXT FROM db into @dbname
while(@@FETCH_STATUS<>-1)
BEGIN
if(@@FETCH_STATUS<>-2)
BEGIN
set @sql = 'BACKUP LOG '+@dbname+' WITH TRUNCATE_ONLY'
print @sql
exec(@sql)
END
FETCH NEXT FROM db into @dbname
END
CLOSE db
DEALLOCATE db
--print '------------'
--print @totalcount
GO
AS
declare db cursor LOCAL for SELECT NAME FROM sysdatabases
declare @dbname varchar(200),@sql varchar(2000)
OPEN db
FETCH NEXT FROM db into @dbname
while(@@FETCH_STATUS<>-1)
BEGIN
if(@@FETCH_STATUS<>-2)
BEGIN
set @sql = 'BACKUP LOG '+@dbname+' WITH TRUNCATE_ONLY'
print @sql
exec(@sql)
END
FETCH NEXT FROM db into @dbname
END
CLOSE db
DEALLOCATE db
--print '------------'
--print @totalcount
GO