The below query can be used to add a new column to every single table in a database.
Use [db]
go
exec sp_MsForEachTable 'alter table ? add Load_date datetime null'
Thats it. You are done. Change the database name for the other databases.
So it is not just adding a column to all table, but modifying anything similar for each table in a database. You can change the SQL statement within the single quotes.
No comments:
Post a Comment