1

I am working ok a query that involves a sql_variant data type in Azure DWH. But I don't seem to get it right

I have a table that contains a column with integers. And I have the system view sys.partition_range_values. The column [value] in this view is of the sql_variant datatype. No I want to join the first table with this view, to retrieve the partition numbers of the table. I want to join the two tables based on the integer column in the first table and the [value] column of the sys.partition_range_values view. But that does not work.

When I join them by casting the sql_variant column to INT it gives the error stated next

Msg 100077, Level 16, State 1, Line 17 Unsupported data type error. Statement references a data type that is unsupported in Parallel Data Warehouse, or there is an expression that yields an unsupported data type. Modify the statement and re-execute it.

When I join the tables on the columns without casting I get the same error. When I cast both column to (n)varchar) also the same error occurs.

How to join these two tables?

jbazelmans
  • 283
  • 1
  • 6
  • 16

0 Answers0