/* segunda-feira, 30 de Agosto de 201012:13:22 User: sa Server: ELEANOR\ELEANOR Database: BeProd_000 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_Tbl_ArtigosDescricoes ( IntId int NOT NULL IDENTITY (1, 1), StrCodigoObra nvarchar(20) NOT NULL, StrFase nvarchar(50) NOT NULL, StrCodigoArtigo nvarchar(20) NOT NULL, StrDescricaoArtigo nvarchar(150) NOT NULL, BitEliminado bit NULL, StrUser nvarchar(50) NOT NULL, DtmDataRegisto datetime NOT NULL ) ON [PRIMARY] GO SET IDENTITY_INSERT dbo.Tmp_Tbl_ArtigosDescricoes ON GO IF EXISTS(SELECT * FROM dbo.Tbl_ArtigosDescricoes) EXEC('INSERT INTO dbo.Tmp_Tbl_ArtigosDescricoes (IntId, StrCodigoObra, StrFase, StrCodigoArtigo, StrDescricaoArtigo) SELECT IntId, StrCodigoObra, StrFase, StrCodigoArtigo, StrDescricaoArtigo FROM dbo.Tbl_ArtigosDescricoes WITH (HOLDLOCK TABLOCKX)') GO SET IDENTITY_INSERT dbo.Tmp_Tbl_ArtigosDescricoes OFF GO DROP TABLE dbo.Tbl_ArtigosDescricoes GO EXECUTE sp_rename N'dbo.Tmp_Tbl_ArtigosDescricoes', N'Tbl_ArtigosDescricoes', 'OBJECT' GO ALTER TABLE dbo.Tbl_ArtigosDescricoes ADD CONSTRAINT PK_Tbl_ArtigosDescricoes 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.Tbl_ArtigosDescricoes', 'Object', 'ALTER') as ALT_Per, Has_Perms_By_Name(N'dbo.Tbl_ArtigosDescricoes', 'Object', 'VIEW DEFINITION') as View_def_Per, Has_Perms_By_Name(N'dbo.Tbl_ArtigosDescricoes', 'Object', 'CONTROL') as Contr_Per