Lock/Unlock objects
- All
- DBM Table No. = 1
- Skip Unlicensed
-----------------------------------VARIABLE DECLARATION----------------------------------
DECLARE @DatabaseName SYSNAME,
@Statement NVARCHAR(MAX),
@LockedBy NVARCHAR(30),
@Locked TINYINT
-----------------------------------------PRE STEP----------------------------------------
SET @DatabaseName = N''
SET @LockedBy = N''
SET @Locked = 0 --Set to 1 for lock
-------------------------------DO NOT EDIT UNDER THIS LINE-------------------------------
SET @Statement = N'UPDATE [' + @DatabaseName + '].[dbo].[Object] SET [Locked] = @locked, [Locked By] = CONVERT(NVARCHAR(30), @lockedby) WHERE [Type] IN (1, 3, 5, 6, 7, 8, 9)';
EXEC sp_executesql @Statement,
@parameters = N'@locked tinyint, @lockedby Nvarchar(30)',
@locked = @Locked,
@lockedby = @LockedBy
-----------------------------------VARIABLE DECLARATION----------------------------------
DECLARE @DatabaseName SYSNAME,
@Statement NVARCHAR(MAX),
@LockedBy NVARCHAR(30),
@Locked TINYINT
-----------------------------------------PRE STEP----------------------------------------
SET @DatabaseName = N''
SET @LockedBy = N''
SET @Locked = 0 --Set to 1 for lock
-------------------------------DO NOT EDIT UNDER THIS LINE-------------------------------
SET @Statement = N'UPDATE [' + @DatabaseName + '].[dbo].[Object] SET [Locked] = @locked, [Locked By] = CONVERT(NVARCHAR(30), @lockedby) WHERE [Type] IN (1, 3, 5, 6, 7, 8, 9) AND [DBM Table No_] = 1';
EXEC sp_executesql @Statement,
@parameters = N'@locked tinyint, @lockedby Nvarchar(30)',
@locked = @Locked,
@lockedby = @LockedBy
-----------------------------------VARIABLE DECLARATION----------------------------------
DECLARE @DatabaseName SYSNAME,
@Statement NVARCHAR(MAX),
@LockedBy NVARCHAR(30),
@Locked TINYINT
-----------------------------------------PRE STEP----------------------------------------
SET @DatabaseName = N''
SET @LockedBy = N''
SET @Locked = 0 --Set to 1 for lock
-------------------------------DO NOT EDIT UNDER THIS LINE-------------------------------
SET @Statement = N'UPDATE [' + @DatabaseName + '].[dbo].[Object] SET [Locked] = @locked, [Locked By] = CONVERT(NVARCHAR(30), @lockedby) WHERE [Type] IN (1, 3, 5, 6, 7, 8, 9) AND NOT ([Type] = 5 AND [ID] IN (6000800, 6000915, 6005558))';
EXEC sp_executesql @Statement,
@parameters = N'@locked tinyint, @lockedby Nvarchar(30)',
@locked = @Locked,
@lockedby = @LockedBy