Reputation: 588
I have a huge database in Sql-Server and I need to get all the names of the tables into one new table that I have made. This can be done? I appreciate your help. The new table has the fields ID, TableName, Status. Id is the identity and status for now will be 1, not null
Upvotes: 1
Views: 566
Reputation: 6292
Use this query below to get all tables name from your database
SELECT name FROM sys.tables
Then you can do a insert query like -
insert into newtable(name) select * from sys.tables
Upvotes: 3