Hello, I'm attempting to insert this record into a new export I'm creating. Some lines I've customized and have inserted fine, but this one which I've copy from a previous export with the exception of the export id (1042) I'm having no luck with.
Here is the sql:
Insert into TS_EXP_DEF_SQL Values (1042,'VANILLA','Y','TS_ORDER.ORDER_ID NOT IN (SELECT TS_ORDER','ORDER_ID FROM TS_ORDER,CSM_SECURITY WHERE TS_ORDER.SEC_ID',18,31,'=','AND','SYB','N','CSM_SECURITY.SEC_ID AND TS_ORDER.INV_CLASS_CD = ''OPTN'' AND CSM_SECURITY.LIST_EXCH_CD IN (''XOTC'',''OTC'')))'
and here is the error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'CSM_SECURITY.SEC_ID AND TS_ORDER.INV_CLASS_CD = 'OPTN' AND CSM_SECURITY.LIST_EXCH_CD IN ('XOTC','OTC')))'.
I've tried numerous alternatives with 1, 2, 3 tics around the text but nothing I've tried is working. Any ideas?