
BEGIN TRANSACTION
ALTER TABLE dbo.[doc_documento.gasto] SET (LOCK_ESCALATION = TABLE)
COMMIT
GO

BEGIN TRANSACTION
if not exists(select 1 from sys.objects where name='FK_ort_reporteTecnico_doc_documento_gasto')
	ALTER TABLE dbo.ort_reporteTecnico ADD CONSTRAINT
		FK_ort_reporteTecnico_doc_documento_gasto FOREIGN KEY
		(
		[id_documento.gasto]
		) REFERENCES dbo.[doc_documento.gasto]
		(
		id
		) ON UPDATE  NO ACTION 
		 ON DELETE  NO ACTION 
	
ALTER TABLE dbo.ort_reporteTecnico SET (LOCK_ESCALATION = TABLE)
COMMIT
GO


BEGIN TRANSACTION
ALTER TABLE dbo.doc_documento SET (LOCK_ESCALATION = TABLE)
COMMIT
GO

BEGIN TRANSACTION
if not exists(select 1 from sys.objects where name='FK_doc_documento_gasto_doc_documento')
ALTER TABLE dbo.[doc_documento.gasto] ADD CONSTRAINT
	FK_doc_documento_gasto_doc_documento FOREIGN KEY
	(
	id
	) REFERENCES dbo.doc_documento
	(
	id
	) ON UPDATE  NO ACTION 
	 ON DELETE  NO ACTION 
	
ALTER TABLE dbo.[doc_documento.gasto] SET (LOCK_ESCALATION = TABLE)
COMMIT
GO
