2

I have a table that has a column with SQL_Variant type and some other columns with types like int, bigint,... When I add this table to edmx file it adds all columns but the SQL_Variant typed column. Is there a bug or I have to do something to add that column?

mrtaikandi
  • 6,753
  • 16
  • 62
  • 93
  • 1
    and it is Nov 2018 - almost 10 years later the support is still not there in EF6.0 I am still getting Error 6005: The data type 'sql_variant' is currently not supported for the target Entity Framework version ... blah blah blah. – joedotnot Nov 11 '18 at 03:14

2 Answers2

5

The entity framework doesn't support sql_variant. If you have to use that type in your code, you've to use another o/r mapper.

Frans Bouma
  • 8,259
  • 1
  • 27
  • 28
3

There is a solution for read-only access.

  • Just to explain what the link provides without having to go there and read through it all... The article shows a way to write an extension method to do a convert and get a concrete value rather than the complex_type that EF complains about. It is read only because that conversion is one way. – Jason Short Apr 20 '11 at 18:45