Update several tables with same column names

  • Hi,

    I'm sure this is quite easy but i just cant think!

    I need to update a column to the same value on 6 different tables. The column names are the same.

    Is there a simple way without having to do each table seperately?

    Thanks

    MH

  • AFAIK, there is no simple way. You have to update the tables separately.

    If this is something you need to do often, you might want to construct a stored procedure for doing this.

  • Agree, no simple way.

    If the table names have something unique and common, eg all start with fred (fred1,fred2 etc) the you could use sp_MSforeachtable to repeat the update on each table.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Thanks Guys! Manually it is then....

    Meg

Viewing 4 posts - 1 through 3 (of 3 total)

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