Logo

Web, mobile, programming problem solving

Query table containing spatial datatype over linked server

By admin - Last Upadate: Friday, March 3, 2017 - Save & Share - 4 Comments

If the target table containing column with spatial datatype, and you like to do the following query,

SELECT * FROM [LinkedServerName].[DatabaseName].dbo.MyPolygon

it will return

Objects exposing columns with CLR types are not allowed in distributed queries. Please use a pass-through query to access remote object

The work around is

SELECT * FROM OPENQUERY([LinkedServerName], ‘SELECT * FROM [DatabaseName].dbo.MyPolygon’)



Posted in SQL • • Top of Page

4 Responses to "Query table containing spatial datatype over linked server"

Comment from joke
Time April 19, 2017 03:47 PM

useful

Comment from Nihao
Time April 19, 2017 03:53 PM

great

Comment from zenhao
Time April 19, 2017 03:55 PM

awsome

Comment from dag
Time April 24, 2017 03:45 PM

af

Wirte a comment

  Name

  Email (will not be published)

  Website

Captcha: five - = 4