2021年3月10日星期三

Add new column to all tables in database

I'm trying to figure out if there's a quick way or single query to add a new column to all tables in database.

Right now I'm doing this for each table

ALTER TABLE [dbo].[%TABLE_NAME%] ADD %COLUMN_NAME% DATATYPE NOT NULL DEFAULT %VALUE%;  

Is there a procedure or query I can make in AzureDataStudio to add a new column to all tables with the same name and default value.

https://stackoverflow.com/questions/66572207/add-new-column-to-all-tables-in-database March 11, 2021 at 04:14AM

没有评论:

发表评论