We can get entire table from database & print the table’s names in TSQL using sp_MSforeachtable SP, This is a hidden Stored Procedure in sql server.
How to use this SP
1-
EXEC sp_MSforeachtable @command1 = "SELECT * FROM ?"
This will return all the rows form all the table from database.
2-
EXEC sp_MSforeachtable @command1 = "PRINT '?'"
This will print the table’s names with owner
Posted by - SUHAS R. KUDEKAR (MCTS - Microsoft Business Intelligence)
Learning Office 2010 + SharePoint 2010 + SQL Server 2008 R2
No comments:
Post a Comment