• greeshma.patla (9/11/2012)


    MERGE INTO LKP_PARAM_TYPE AS C

    USING (

    SELECT

    DISTINCT RISK_PARAMETERS

    FROM SRC_DOM_RETAIL_AIRB_PARAM )X -- I think this bracket is the problem, remove it

    ) AS CT

    ON C.PARAM_DESC = CT.RISK_PARAMETERS

    WHEN NOT MATCHED

    THEN

    INSERT(PARAM_TYPE_ID,PARAM_DESC)

    VALUES(@MAX_ID+1,CT.RISK_PARAMETERS);

    This looks like a problem with closing brackets, I have put a comment on the code above.

    If this does not solve your problem, please post the error that you are receiving

    I would also like to say that IDENTITY is the best way to achieve your requirement

    Can you tell us why you are avoiding the IDENTITY property?


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/