Add a column to all user tables in a Database

  • I am trying to add a new column to every user table in my database. Does anyone know the script for this?

  • no script I know of. Should be able to build a serise of commands using system views.

    select 'alter table ' + table_name + ' add column xxx'

    from information_schema.tables

    Steve Jones

    steve@dkranch.net

  • Try sp_MSforeachtable It is a system sp. -JG


    -JG

  • quote:


    Try sp_MSforeachtable It is a system sp. -JG


    Thank you very much. That solved my problem!

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

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