View definition from a Linked Server

  • Is it possible to get a definition of a view from a linked server via OpenQuery command?

    As the create, alter and drop options for the view are not available in SSMS yet the list of views are displayed. The linked server is a MySQL and the connection is via an ODBC driver v5.1.

  • There probably is a way to query a View's definition in MySQL, similar to querying various metadata objects in SQL Server, but you're probably going to have better luck finding the way to do that on a MySQL forum. You might get lucky and find someone here who happens to know that kind of thing, but since this is an SQL Server site, it would be by luck. On a MySQL site, it'll be easier.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • I got it to work via SQL as I did not have the required permissions on the remote MySQL.

    In SSMS I used the import data using my SQL server as the source but then specifying the T-SQL using the OpenQuery statement to the linked server which then returned the fields and definition to SQL.

  • Excellent on getting what you needed. Sorry I couldn't help more, but at least you worked it out.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply