19 Eylül 2018 Çarşamba

Sql'de tüm tablolar hızlı column ekleme

Sql'de tüm tablolar hızlı column ekleme;

EXEC sp_MSforeachtable '
if not exists (select * from sys.columns
               where object_id = object_id(''?'')
               and name = ''NewColoum'')
begin
    ALTER TABLE ? ADD NewColoum bit NOT NULL DEFAULT 0;
end';

Hiç yorum yok:

Yorum Gönder