sp_MSforeachtable @command1="ALTER TABLE ? ADD id int IDENTITY PRIMARY KEY CLUSTERED"
The good thing is that it if it fails for some table, it doesn’t fail for all.
solved How to add a primary key to all tables in SQL Server?
sp_MSforeachtable @command1="ALTER TABLE ? ADD id int IDENTITY PRIMARY KEY CLUSTERED"
The good thing is that it if it fails for some table, it doesn’t fail for all.
solved How to add a primary key to all tables in SQL Server?