/* 12 de outubro de 201816:23:22 User: BETRACE Server: DEVSERVER\SQLEVOLUTION Database: BeProd_PLAS Application: */ /* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/ BEGIN TRANSACTION SET QUOTED_IDENTIFIER ON SET ARITHABORT ON SET NUMERIC_ROUNDABORT OFF SET CONCAT_NULL_YIELDS_NULL ON SET ANSI_NULLS ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON COMMIT BEGIN TRANSACTION GO CREATE TABLE dbo.Tmp_Mov_Interrupcoes ( intId int NOT NULL IDENTITY (1, 1), intId_Operacao int NOT NULL, intId_Maquina int NOT NULL, strSerieOF varchar(50) NOT NULL, intId_OF int NOT NULL, strOperador varchar(50) NOT NULL, dtmDataInicioInterrupcao datetime NOT NULL, dtmDataFimInterrupcao datetime NULL, intId_Motivo int NOT NULL ) ON [PRIMARY] GO ALTER TABLE dbo.Tmp_Mov_Interrupcoes SET (LOCK_ESCALATION = TABLE) GO SET IDENTITY_INSERT dbo.Tmp_Mov_Interrupcoes ON GO IF EXISTS(SELECT * FROM dbo.Mov_Interrupcoes) EXEC('INSERT INTO dbo.Tmp_Mov_Interrupcoes (intId, intId_Operacao, intId_Maquina, intId_OF, strOperador, dtmDataInicioInterrupcao, dtmDataFimInterrupcao, intId_Motivo) SELECT intId, intId_Operacao, intId_Maquina, intId_OF, strOperador, dtmDataInicioInterrupcao, dtmDataFimInterrupcao, intId_Motivo FROM dbo.Mov_Interrupcoes WITH (HOLDLOCK TABLOCKX)') GO SET IDENTITY_INSERT dbo.Tmp_Mov_Interrupcoes OFF GO DROP TABLE dbo.Mov_Interrupcoes GO EXECUTE sp_rename N'dbo.Tmp_Mov_Interrupcoes', N'Mov_Interrupcoes', 'OBJECT' GO ALTER TABLE dbo.Mov_Interrupcoes ADD CONSTRAINT PK_Mov_Interrupcoes PRIMARY KEY CLUSTERED ( intId ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO COMMIT select Has_Perms_By_Name(N'dbo.Mov_Interrupcoes', 'Object', 'ALTER') as ALT_Per, Has_Perms_By_Name(N'dbo.Mov_Interrupcoes', 'Object', 'VIEW DEFINITION') as View_def_Per, Has_Perms_By_Name(N'dbo.Mov_Interrupcoes', 'Object', 'CONTROL') as Contr_Per