T-SQL update

  • Hi,

    I am running below query in sql studio and I am getting syntax error near inner, any suggestions??

    Thank You

    UPDATE [dbo].[progoogle] INNER JOIN [dbo].[stocktb] ON [dbo].[progoogle].productid = [dbo].[stocktb].[productid] SET [dbo].[progoogle].[ActiveFlag] = 'N' WHERE [dbo].[stocktb].[available_qty] = '0' and [dbo].[stocktb].[avaiable_qty_temp] = '0'

  • Please see BOL (BooksOnLine, the SQL Server help system usually installed together with SQL Server) for the correct syntax (SET before FROM part):

    UPDATE [dbo].[progoogle]

    SET [ActiveFlag] = 'N'

    FROM [dbo].[progoogle]

    INNER JOIN [dbo].[stocktb] ON [dbo].[progoogle].productid = [dbo].[stocktb].[productid]

    WHERE [dbo].[stocktb].[available_qty] = '0' and [dbo].[stocktb].[avaiable_qty_temp] = '0'



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

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