Share via

describe views

Shambhu Rai 1,411 Reputation points
2023-02-02T16:32:16.5066667+00:00

Hi Expert,

how we can view columns of the view

i.e. desc view view_name but can not see its column and datatype to copy and create new table using metadata

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.

SQL Server Reporting Services
SQL Server Reporting Services

A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.

SQL Server Integration Services
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


2 answers

Sort by: Most helpful
  1. Jingyang Li 5,901 Reputation points Volunteer Moderator
    2023-02-02T20:13:47.5666667+00:00

    You can use the query Yitzhak provided. Or you can run the following:

    sp_help yourViewname

    Was this answer helpful?

    0 comments No comments

  2. Yitzhak Khabinsky 27,196 Reputation points
    2023-02-02T16:40:27.41+00:00

    Hi @Shambhu Rai,

    You can try to use INFORMATION_SCHEMA.COLUMNS.

    Please see below.

    USE AdventureWorks2019;
    GO
    
    SELECT * 
    FROM AdventureWorks2019.INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'vEmployee';
    

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.