Sorry, but I need syntax help :( This needs to run on SQL Server 2005 +
DELETE SO, ASO, ASOV, AOV
FROM SYS_OPTION SO
INNER JOIN ADM_SYS_OPTION ASO on SO.OPTION_ID = ASO.OPTION_ID
INNER JOIN ADM_SYS_OPTION_V ASOV on ASOV.SYS_OPTION_ID = ASO.SYS_OPTION_ID
INNER JOIN ADM_OPTION_VALUE AOV ON AOV.SYS_OPTION_ID = ASO.SYS_OPTION_ID
WHERE SO.OPTION_ID = 133
AND SO.SYSTEM_OPTION_NM = 'APLY_RES_ON_POL'
AND SO.SYSTEM_OPTION_DESC = 'Indicates on what policies batch order response needs to be applied. Default is do not apply the batch order response'
AND SO.ADM_LIST_TYPE = 'APPLY_ORDER_RES_OP'
AND SO.ADM_LIST_SUB_TYPE = 'OPTION'
AND SO.DISPLAY_TYPE = 6
AND SO.UPDATED_BY = 10000
;
Gives me: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ','.
I've been staring at it for the better part of an hour and I cannot for the life of me figure out what I'm doing wrong :(
Thanks in advance for being kind when fixing my stupid mistake.
DELETE
statement can only delete from 1 table. You'll have to rewrite, using 4 deletes, if you want to delete from 4 tables. – ypercube Jul 10 at 16:39