sql-variant

Problem with Entity Framework Model Designer and SQL_Variant datatype

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? ...

What is the best way to define a column in SQL server that may contain either an integer or a string?

I have a situation where two objects of the same type have parents of different types. The following pseudo code explains the situation the best: TypeA a1, a2; TypeB b; TypeC c; a1.Parent = b; a2.Parent = c; To complicate things even further TypeB and TypeC may have primary keys of different types, for instance, the following assertio...

What is the cost in bytes for the overhead of a sql_variant column in SQL Server?

I have a table, which contains many columns of float data type with 15 digit precision. Each column consumes 8 bytes of storage. Most of the time the data does not require this amount of precision and could be stored as a real data type. In many cases the value can be 0, in which case I could get away with storing a single byte. My goal...

I can't compare sql_variant field with IS NULL operator

I mean I can't query null values when column type sql_variant For example docsdate table look like this: ValID DocID Value <--sql variant column) 1. 488 146 30.10.2007 2. 740 190 31.03.2008 3. 570 161 31.10.2008 4. 242 103 NULL 5. 248 104 NULL When query like select * from docsdate where value is ...