From 2a44c64e4001ea27a21b49cbb464acf188bc9a04 Mon Sep 17 00:00:00 2001 From: robvde Date: Wed, 4 Jul 2012 18:57:33 +0400 Subject: [PATCH] Column verification added before extending an existing table --- WebsitePanel/Database/update_db.sql | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index a9963878..56c023d4 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -856,31 +856,17 @@ END GO - - - - - - - +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='GlobalDnsRecords' AND COLS.name='SrvPriority') +BEGIN ALTER TABLE [dbo].[GlobalDnsRecords] ADD [SrvPriority] [int] NULL, [SrvWeight] [int] NULL, [SrvPort] [int] NULL - +END GO - - - - - - - - - ALTER PROCEDURE [dbo].[AddDnsRecord] ( @ActorID int, @@ -1129,13 +1115,7 @@ GO -USE [WebsitePanel] -GO -/****** Object: StoredProcedure [dbo].[GetDnsRecordsByServer] Script Date: 06/01/2011 23:42:41 ******/ -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO + ALTER PROCEDURE [dbo].[GetDnsRecordsByServer] (