Questions tagged [sql-variant-property]
The sql-variant-property tag has no usage guidance.
10 questions
7
votes
2
answers
1k
views
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(...
0
votes
1
answer
3k
views
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 ...
2
votes
1
answer
223
views
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?
6
votes
1
answer
173
views
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 ...
1
vote
1
answer
93
views
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....
8
votes
2
answers
52k
views
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, ...
6
votes
1
answer
6k
views
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(@...
13
votes
2
answers
7k
views
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 ...
-1
votes
2
answers
1k
views
"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 ...
4
votes
4
answers
3k
views
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 ...