Skip to content

Instantly share code, notes, and snippets.

Antonio Leonardo antonio-leonardo

Block or report user

Report or block antonio-leonardo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@antonio-leonardo
antonio-leonardo / shrink_cursor.sql
Created Jun 11, 2019
Sql Server: Cursor that automate shrink all logs
View shrink_cursor.sql
SET NOCOUNT ON;
DECLARE @name VARCHAR(MAX)
,@DBName SYSNAME
,@LogicalLogFile SYSNAME
,@SQL_CMD_ALTER_0 VARCHAR(MAX);
DECLARE clear_logs_cursor CURSOR FOR
SELECT name FROM master.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb');
You can’t perform that action at this time.