Questions tagged [sql-variant]

Describes something rather similar to SQL but not actual ANSI-Complient SQL.

43 questions
1
vote
1 answer

How to Handle sql_Variant sql datatype using Powershell

I am using the power shell to execute one of the stored procedure which has one of the parameter with the datatype sql_Variant and resided in the SSISDB (System stored procedure) As sql_variant supports multi datatype I am passing int,string &…
Roshan Nuvvula
  • 803
  • 1
  • 8
  • 28
1
vote
0 answers

How to query a table that contains sql_variant in sqlalchemy

I am trying to query an instance of a mapped class with sqlalchemy that contains a column with a sql_variant data type. However, when executing my query, I get the following error: sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('ODBC…
Eric B
  • 1,635
  • 4
  • 13
  • 27
1
vote
1 answer

Original data type reference when using Sql_Variant

I am creating a table with an SQLVariant data type. The values stored within the variant column could be string, integer, and/or datetime. I read about the pitfalls of sqlvariant, but as the column isn't being indexed, or used in WHERE clauses, it…
EvilDr
  • 8,943
  • 14
  • 73
  • 133
1
vote
0 answers

trouble with sql_variant data-type

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…
jbazelmans
  • 283
  • 1
  • 6
  • 16
1
vote
1 answer

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 …
aeon
  • 11
  • 3
1
vote
1 answer

Avoid sql_variant but use what?

My database holds template forms and real forms having values. Users will be able to create custom template forms with different types of fields. I will keep values in a separate table. Forms table: Id | Name | TemplateId FormFields table: Id |…
aliassce
  • 1,197
  • 6
  • 19
1
vote
0 answers

i need use sql_variant in entity framework code first

i have to define dynamic parameters value in database for invoke my methods in C# by these parameters. BTW,i just use simple varibale such as int,bool,string,datetime.... but unfortunately i can't get value from sql_variant field to object in my…
Mahdi Farhani
  • 964
  • 1
  • 9
  • 22
1
vote
1 answer

How is it possible that this select statement works, but this update statement does not in VFP 9?

Overview I am trying to write a select statement in Visual Fox Pro 9 (VFP9) to update a row (and eventually several other records, I wrote a select statement first and it worked great, I got the expected result. But I'm a little new to VFP9 syntax,…
leeand00
  • 25,510
  • 39
  • 140
  • 297
1
vote
0 answers

Why sql_variant datatype is not common in development?

I was looking at system tables and saw sql_variant datatype for some of the columns. I have never seen any column with sql_variant datatype in production databases. Is there any reason for this.
Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286
1
vote
0 answers

linq with Any and sql_variants

i have a problem with sql_variants i have 2 tables and a DTO 'struct A_Table1 ' id (int)(not null) ' wert (sql_variant)(not null) 'struct A_Table2 ' id (int)(not null) ' wert (sql_variant)(not null) Private Class DTO Public Property id As…
rene marxis
  • 385
  • 2
  • 13
0
votes
1 answer

SQL_Variant or separated data type value in EAV?

We use sql_variant data type for value in EAV, but I think it's better that we use one table for each data type value because sql_variant is 8000 byte and I'm worried about this data type for huge value. What's your idea? Which them is better?…
FS-DBA
  • 41
  • 4
0
votes
1 answer

How to convert sql_variant so it can be considered deterministic

I am trying to create a persisted computed column in a SYSTEM_VERSIONING table dbo.Users as follows: ALTER TABLE dbo.Users ADD SessionId AS usr.GetSession() PERSISTED CONSTRAINT FK_dboUsers_IdSession FOREIGN KEY REFERENCES…
0
votes
0 answers

sql_variant and real and float in combination with WHERE smaller statements

I am using a sql_variant field at MS SQL Server 2019. Select queries containing a WHERE < clause are not working when inserting a number as real or float. It does work when insering as numeric. Not working means, smaller values were not…
Baumfaust
  • 31
  • 5
0
votes
0 answers

Non-dynamic way to change sql_variant collation and keep type and size

SQL Server 2019. I am looking for a solution to change the collation of sql_variant values in a select statement, if there is one. The proplem is that the COLLATE operator cannot be applied to sql_variant data types. The select queries are…
Yargo
  • 58
  • 5
0
votes
1 answer

I want to use SQL_VARIANT datatype in external table Azure SQL and I get the "Index was out of range error."

I have two SQL Azure databases - DatabaseA and DatabaseB on a server hosted in Azure. I need to access a view on DatabaseA from DatabaseB - namely I need the sys.identity_columns in DatabaseA to be available to me on DatabaseB. So I am creating…
JJK
  • 23
  • 3