Alter PROCEDURE "CXSINTEGRATION"."AlterTable_Column_IntegrationMapping"
(
)
as
BEGIN
DECLARE ColumnCount INT:=0;
select COUNT("SCHEMA_NAME") INTO ColumnCount from SYS.COLUMNS WHERE "COLUMN_NAME"='IVendID'AND "SCHEMA_NAME"='CXSINTEGRATION'
AND "DATA_TYPE_NAME" ='BIGINT';
IF :ColumnCount>0 THEN
CREATE TABLE "CXSINTEGRATION"."IntegrationMapping_New" ( "ObjectID" int NOT NULL,
"IVendID" nvarchar(1000) NOT NULL,"SBOID" int NOT NULL,
"DBName" nvarchar(100) NOT NULL, PRIMARY KEY ( "ObjectID","SBOID" ,"DBName" ) );
INSERT INTO "CXSINTEGRATION"."IntegrationMapping_New"(SELECT * FROM "CXSINTEGRATION"."IntegrationMapping");
DROP TABLE "CXSINTEGRATION"."IntegrationMapping";
CREATE TABLE "CXSINTEGRATION"."IntegrationMapping" ( "ObjectID" int NOT NULL,"IVendID" nvarchar(1000) NOT NULL,"SBOID" int NOT NULL,
"DBName" nvarchar(100) NOT NULL,PRIMARY KEY ( "ObjectID" ,"SBOID" ,"DBName" ) );
INSERT INTO "CXSINTEGRATION"."IntegrationMapping"
(SELECT * FROM "CXSINTEGRATION"."IntegrationMapping_New");
DROP TABLE "CXSINTEGRATION"."IntegrationMapping_New";
END IF ;
END ;