How to list all tables & columns names of a linked-server database in SQL Server?

前端 未结 4 1977
情书的邮戳
情书的邮戳 2021-01-13 02:20

If it\'s a regular database, i can simply use this query to get a list of all table names and their column names of the database.

use [my_database_name]
GO

         


        
4条回答
  •  忘掉有多难
    2021-01-13 02:47

    The system stored procedure sp_tables is used to list out the tables available in the current database of the current server. You can use sp_tables_ex for the linked server. The following returns list of tables available in the specified Server:

    EXEC sp_tables_ex @table_server = 'MYSQL_DB'
    

提交回复
热议问题