• ChrisM@Work (7/18/2013)


    kapil_kk (7/18/2013)


    If you specify alias with TOP in delete it will always gives you an error:

    e.g.

    DELETE TOP (2)

    FROM tbl1 t

    Your syntax is incorrect:

    DELETE TOP (2) t

    FROM tbl1 t

    delete top(1000) a

    from table a

    join table b

    on a.id = b.id

    and b.date < getdate()

    OK

    Thanks Chris for correcting me

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/