update o_file

  • MSSql 7

    I'm trying to update a table.

    update o_file f

    set groupid = 213

    where columnx 215

    and exists

    (select * from stutable1 a

    where f.fileid = a.o_objid)

    I get

    Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near 'f'.

  • Try this

    update f

    set f.groupid = 213

    from o_file as f

    where f.columnx = 215

    and exists

    (select * from stutable1 a

    where f.fileid = a.o_objid)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply