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.
9,096 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 72,341 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.
    No comments

  2. Guoxiong 8,056 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;