/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_VIE_TURNS') 
 CREATE TABLE T_SRC_VIE_TURNS (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FOPENDATE DATETIME,
FTURNS CHAR(2) DEFAULT ' ' NOT NULL,
FBIDTIME DATETIME,
FBIDSTATUS CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_DETAIL' AND KSQL_COL_NAME ='FPURLISTID') 
 ALTER TABLE T_SRC_VIE_DETAIL ADD (FPURLISTID BIGINT DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_SRC_PURLISTENTRY', 'FMATERIALMODEL', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SRC_table.sql **/
