/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCKENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTID')) 
 ALTER TABLE T_PUR_INSTOCKENTRY_A ADD (FSALOUTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCKENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTENTRYID')) 
 ALTER TABLE T_PUR_INSTOCKENTRY_A ADD (FSALOUTENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCKENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTNUM')) 
 ALTER TABLE T_PUR_INSTOCKENTRY_A ADD (FSALOUTNUM NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTID')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FSALOUTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTENTRYID')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FSALOUTENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTNUM')) 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FSALOUTNUM NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RETURNENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTID')) 
 ALTER TABLE T_PUR_RETURNENTRY_A ADD (FSALOUTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RETURNENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTENTRYID')) 
 ALTER TABLE T_PUR_RETURNENTRY_A ADD (FSALOUTENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RETURNENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTNUM')) 
ALTER TABLE T_PUR_RETURNENTRY_A ADD (FSALOUTNUM NVARCHAR(80) DEFAULT ' ' NOT NULL );
/**End C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
