Describes something rather similar to SQL but not actual ANSI-Complient SQL.
Questions tagged [sql-variant]
43 questions
0
votes
1 answer
How to create a subset from a variant column in snowflake?
For example, suppose my variant column "xyz" consists of data like this:
{
"post_new_visits": "Repeat",
"post_new1_week": "Thursday",
"post_new2_appt": "Weekday",
"post_new3_site": "12:50AM",
"post_new4_channel": "5.0",
"pre_new2_appt":…

Manu
- 51
- 1
- 6
0
votes
1 answer
Importing SQL Server SQL_VARIANT data type to OrientDB vertex - which property type should I use?
I am evaluating OrientDB as a replacement for MS SQL Server. One of the SQL Server tables I need to import into OrientDB contains time-series data with the value column using a SQL_VARIANT data type. I'm struggling to identify the best data type…

Demtron
- 21
- 4
0
votes
1 answer
PostgreSQL Function that updates a specific column of a row
I am trying to make a function which calls a specific data from the table but why it's showing column doesn't exist even tho its on database .
CREATE FUNCTION public."updateDB"(IN userid bigint DEFAULT 00000, OUT uinfo json, IN clname text DEFAULT…

Axel
- 23
- 1
- 8
0
votes
1 answer
Problems passing variables into a stored procedure as sql_variant type
I am having troubles when trying to pass variables of different types into a stored procedure that receives the variables as SQL_Variants.
Here is the stored procedure I am calling:
CREATE PROCEDURE [dbo].[usp_GetOrCreateCorrespondenceBatchID]
…

MichaelInOr
- 21
- 3
0
votes
1 answer
Convert byte array represented for sql_variant typed column value to long/int64
I have a byte array value of 10 elements taken from an sql_variant column in my database table and would like to convert it to a long value. I tried this.
byte []a = new byte[10]{ 127, 1, 0, 202, 154, 59, 0, 0, 0, 0 };
long i =…

user1532265
- 67
- 6
0
votes
1 answer
PyMsSQL reading bad data for sql_variant columns
I am using pymssql for Python 2.7 with MS SQL Driver. While running some queries on tables having sql_variant column, I am getting bad data. When I cast data, I am able to get correct values.
Is there any way I can skip explicit CAST.

sam
- 11
- 1
- 5
0
votes
1 answer
Try_casting a Sql_variant column truncating the value after a comma
I have a column 'Value' of sql_variant type. It has the value
'Device Warning: Bus Transient, Warning Code: 164, Timestamp: 2015-12-23 13:02:48.750'
If I try to select
TRY_CAST([Value] AS nvarchar) as varvalue
I get the value
Device Warning:…

Aparna
- 835
- 2
- 23
- 47
0
votes
1 answer
How to show values from a sql_variant column with LINQ TO SQL (ASP.NET)?
I generate my classes with Linq to Sql, and i have a column "DataValue" which is a sql_variant.
MODEL
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DataValue", DbType="Variant", UpdateCheck=UpdateCheck.Never)]
public object…

Maxime Gendre
- 13
- 3
0
votes
0 answers
Not able to insert unsigned __int64 value in sql_variant data type column using OLE DB in c++
I am trying to insert a value of type unsigned __int64 in MS Sql Server using OLE DB with C++ for a column which has sql_variant data type column. Although for all other data type I am able to do so.
Code snippet:
HRESULT hrinit =…

Amit
- 228
- 3
- 8
0
votes
0 answers
scalar function returning sql_variant or converted data type?
Giving the following function:
ALTER FUNCTION [dbo].[InlineMax](@val1 sql_variant, @val2 sql_variant)
RETURNS sql_variant
AS
BEGIN
return CASE WHEN @val1 > @val2 THEN @val1 ELSE @val2 END
END
Is it possible to return the same datatype received…

fcaserio
- 726
- 1
- 9
- 18
0
votes
2 answers
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…

Elan
- 6,084
- 12
- 64
- 84
0
votes
1 answer
Filtering data on date but showing all values except one in query if date doesn't match [SQL & C#]
I'm pretty stuck on this query.
First of all, what do I want to achieve?
I want to inner join on three tables (already correct) and filter out data depending if the date is in the current month. If the date is not in the current month the field…

Yenthe
- 2,313
- 5
- 26
- 46
-1
votes
3 answers
Get the non empty data from a sql_varient column
I have a sql table with sql_varient column. I want to query the table to get the records which has value. I used following query
SELECT *
from Table
WHERE sql_varient_column IS NOT NULL
But its return the data which has no data also. How can I…

udaya726
- 1,010
- 6
- 21
- 41