1 ETQ000 ================================================== 1 ETQ399 Executing SQL script '..\var\MSSPREUP.TSQL'. 2 ETQ399 Connecting to database 'mss'. 4 ETQ010 Date & Time: 20200722141637 3 ETQ398 SQL: set nocount on 3 ETQ398 SQL: DECLARE @vers varchar(1) DECLARE @tableNames TABLE (tname SYSNAME NOT 3 ETQ398XSQL: NULL) DECLARE @tname SYSNAME DECLARE @cmd NVARCHAR(MAX) select @vers 3 ETQ398XSQL: = VERSION from SVERS if @vers < '6' BEGIN INSERT @tableNames(tname) 3 ETQ398XSQL: VALUES 3 ETQ398XSQL: ('D010S'),('D010SINF'),('D010L'),('D010LINF'),('ATAB'),('STXH'),('STXL'),('CROSS') 3 ETQ398XSQL: end else begin INSERT @tableNames(tname) VALUES 3 ETQ398XSQL: ('REPOLOAD'),('REPOSRC'),('ATAB'),('STXH'),('STXL'),('CROSS') end 3 ETQ398XSQL: WHILE EXISTS (SELECT tname FROM @tableNames) BEGIN SELECT @tname = 3 ETQ398XSQL: tname FROM @tableNames SET @cmd = 3 ETQ398XSQL: 'if exists(select object_id from sys.indexes where object_id = object_id(schema_name() + ''.[' 3 ETQ398XSQL: + @tname + 3 ETQ398XSQL: ']'', ''U'') and allow_page_locks <> 0 ) BEGIN BEGIN TRAN begin try declare @v int set lock_time 3 ETQ398XSQL: out 5000 SELECT top 1 @v = 1 FROM [' + @tname + 3 ETQ398XSQL: '] WITH (TABLOCKX) where 1 = 0 ALTER INDEX ALL ON [' + 3 ETQ398XSQL: @tname + 3 ETQ398XSQL: '] SET (ALLOW_PAGE_LOCKS = OFF) set lock_timeout -1 end try begin catch if ERROR_NUMBER() <> 1222 3 ETQ398XSQL: begin declare @errmsg nvarchar(2047) set @errmsg = ERROR_MESSAGE() raiserror(@errmsg,16,1 3 ETQ398XSQL: ) end set lock_timeout -1 end catch COMMIT TRAN END' 3 ETQ398XSQL: EXEC(@cmd) DELETE FROM @tableNames WHERE tname = @tname END 3 ETQ398 SQL: set nocount off 1 ETQ000 ================================================== 4 ETQ010 Date & Time: 20200722141637 1 ETQ003 exit code: "0"