开发者

Fetching all the tables and their data in MSSQL and mySQL

Can you guys tell me how to fetch all the tables 开发者_如何学Calong with their records considering we don't know the table names in the database.

Such as :

use my_database
select * from information_schema.tables 
-- gives all the tables from a database 

Also it would be great if you can give mySQL and MSSQL queries.

I thought it would work but didn't work out:

select * from (select [TABLE_NAME] from INFORMATION_SCHEMA.TABLES)


For SQL Server you can use this:

exec sp_msforeachtable 'select * from ?'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜