Sign up ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
2  
In SQL-Server, a 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
    
THANKS! I guess that explains it. :) –  Joe Hayes Jul 10 at 17:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.