Source Table Schema on a different server

VS29 246 Reputation points
2021-07-13T18:50:35.137+00:00

Hi All,

can someone please suggest how I can get the schema of a source table along with constraints while I only have access to source table using linked server only.

thanks in advance..

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,682 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 100.9K Reputation points MVP
    2021-07-13T21:38:55.54+00:00

    Here is another option:

    EXEC LinkedServer.db.sys.sp_help 'dbo.MyTable'
    
    1 person found this answer helpful.
    0 comments No comments

  2. Guoxiong 8,126 Reputation points
    2021-07-13T19:01:27.057+00:00
    SELECT SCHEMA_NAME(schema_id) AS Schema_Name, name AS Table_Name
    FROM [LINKED_SERVER_NAME].[DATABASE_NAME].sys.tables;