Questions tagged [sql-variant-property]
10 questions
13
votes
2 answers
SSIS 2012 Create environment variable fails
I'm working a script to port an Environment from one server to another. I am running into an issue calling catalog.create_environment_variable wherein I get the error "The data type of the input value is not compatible with the data type of the…
billinkc
- 16,143
- 4
- 54
- 89
8
votes
2 answers
Whats SQL Server NVARCHAR(max) equivalent in MySQL?
Using SQL Server you just have to give the "MAX" parameter to the length of a text data type, but in MySQL there's no such a thing.
According to Ispirer:
"n" is the maximum number of characters, optional
Range: 1 ⇐ n ⇐ 21845 (65535 bytes is the…
Jonathan Solorzano
- 241
- 1
- 3
- 7
8
votes
2 answers
Collation conflict when comparing sql_variant with varchar literal
I found that queries below return different results on two Azure Hyperscale databases that are running the same compatibility level, same set options etc.
IF CAST(ServerProperty('Edition') AS nvarchar(128)) = 'SQL Azure' BEGIN
SELECT 1
END
IF…
Lukas.Navratil
- 355
- 2
- 10
6
votes
1 answer
Why does implicit conversion from sql_variant (basetype decimal) not work well with float
Why is ResultFloat = 0 in the query below?
Am I missing a point within the cast/convert, sql_variant docs?
declare
@v sql_variant = convert(decimal(28,8), 20.0);
select sql_variant_property(@v, 'BaseType') as BaseType, -- 'decimal',
…
crokusek
- 2,110
- 4
- 25
- 34
6
votes
1 answer
Read-ahead reads and SQL-Variant fields
I have two tables containing exactly the same data. Both table have bigint primary key identity column, 60 columns and 300 000 rows. The difference is that all of the columns of the second table have sql-variant type.
I am creating temporary table…
gotqn
- 4,348
- 11
- 52
- 91
4
votes
4 answers
PostgreSQL equivalent of SQL Server SQL_VARIANT_PROPERTY
Does PostgreSQL have an equivalent function for determining column metadata?
Reference: SQL_VARIANT_PROPERTY
pg_typeof() appears to be close, but it does not show the precision and scale. Looking up the type in pg_type only shows the generic type…
孔夫子
- 4,330
- 3
- 30
- 50
2
votes
2 answers
Is sql_variant compatible with First Normal Form (1NF)?
1NF rule says that we should not keep data of different types in one single column. Does it mean that sql_variant is not compatible with first normal form hence should not be used?
igelr
- 2,162
- 3
- 26
- 56
1
vote
1 answer
Report Configuration changes
I created a stored procedure that I got on Erin Stellato's course on Pluralsight to report if there are any configuration changes on the server as a nightly job as follows:
CREATEPROCEDURE dbo.usp_SysConfigReport1
(
@RecentDate DATETIME,
…
SQLBen
- 355
- 1
- 5
- 18
0
votes
1 answer
Passing a variable in OPENJSON WITH statement in SQL Server
Below script calls an API with base and other currency as input and gets foreign exchange(FX) value from its response. While reading the response from api we have to specify '$.rates.GBP' in openjason statement to read value of FX(last statement of…
Ruhi Afreen
- 1
- 1
- 2
-1
votes
2 answers
"Variant" values structure and their use for multiple columns
2017/07/25 note: This was a quite complex question, re-reading it 4 years after I posed it I believe it has still some value, but it's sure hard to understand. You probably shouldn't bother if you're not facing a similar problem. If you see a way to…
gab
- 155
- 8