Sql query or script to add a new colunms in the all tables of
given or specified database in sql server
EXECUTE sp_MSforeachtable @command1 = N'ALTER TABLE ? ADD
dtCreated DATETIME NOT NULL DEFAULT GETDATE()'
This query will
add a new column dtCreated of data type data type in all the tables of current
working database.
Note: sp_MSforeachtable is system stored procedure
1 comment:
Marvellous,
Thank you so much
Post a Comment