/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLIST_ITEM' AND KSQL_COL_NAME IN ('FDEMAND')) 
 ALTER TABLE T_SRC_PURLIST_ITEM ADD (FDEMAND NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLIST_ITEM' AND KSQL_COL_NAME IN ('FDEMANDVALUE')) 
 ALTER TABLE T_SRC_PURLIST_ITEM ADD (FDEMANDVALUE NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MATERIALENDENTRY' AND KSQL_COL_NAME IN ('FSUPPLIERID')) 
 ALTER TABLE T_SRC_MATERIALENDENTRY ADD (FSUPPLIERID BIGINT DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_SRC_BIZITEM', 'FPARAMTYPE', 'VARCHAR(2)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_SRC_BIZITEM', 'FFIELDNAME', 'VARCHAR(50)', 'NOT NULL', '1111', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIZITEM' AND KSQL_COL_NAME IN ('FDEMAND')) 
 ALTER TABLE T_SRC_BIZITEM ADD (FDEMAND NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIZITEM' AND KSQL_COL_NAME IN ('FDEMANDVALUE')) 
 ALTER TABLE T_SRC_BIZITEM ADD (FDEMANDVALUE NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIZSCHEMEENTRY' AND KSQL_COL_NAME IN ('FDEMAND')) 
 ALTER TABLE T_SRC_BIZSCHEMEENTRY ADD (FDEMAND NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIZSCHEMEENTRY' AND KSQL_COL_NAME IN ('FDEMANDVALUE')) 
 ALTER TABLE T_SRC_BIZSCHEMEENTRY ADD (FDEMANDVALUE NVARCHAR(510) DEFAULT ' ' NOT NULL );

/**End C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
