Data Copy activity failing due to a geography data type in one of the columns

Dinesh Kakumanu 11 Reputation points
2021-09-24T10:39:21.187+00:00

I'm copying data from a table in SQL DB to Azure Data lake. One of the columns is of data type Geography and I got to know that ADF doesn't support this data type so the copy activity is failing. Is there any way to copy the whole data including this column at a time using data factory itself?

Below is the error description:

135061-screenshot-2021-09-24-160450.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,539 questions
{count} vote

2 answers

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,026 Reputation points
    2021-09-27T08:05:18.587+00:00

    Hello @Dinesh Kakumanu and welcome to Microsoft Q&A.

    Since Geography type is not supported, how about treating it as text?

    I think the simplest way, would be to write a query, where the Geography columns are converted / typecast as varchar. There is also a geography to string function. In doing this you would need to specify all the columns, but it would work.

    Something like,

    Select ColumnA, Column B, ColumnC, ... GeoAsTextColumn as GeoColumn.ToString(), ColumnX, ColumnY, ColumnZ From MyTable;  
    

  2. Dinesh Kakumanu 11 Reputation points
    2021-09-27T08:08:42.667+00:00

    Hi Martin,

    Thanks for your response.

    But I have a huge number of columns and I don't want to mention all the column names in the query. Can we do something like selecting all the columns except that one?