2024-12-18
1,363 reads
2024-12-18
1,363 reads
2022-07-27
583 reads
The Problem Recently, while working with one of my clients, I came across a script in which I had to introduce a scalar User-Defined Function in the SELECT statement. The SELECT used to return around 750K records. However, after introducing the UDF, the row count significantly increased to 826K. There were no other changes made […]
2019-10-14
5,001 reads
2008-05-20
4,224 reads
This article describes and demonstrates the problem of using asterisk to select all fields from a table within a table function. (from Apr 2008)
2009-09-11 (first published: 2008-04-30)
18,661 reads
This UDF returns a multi column table of values from an input string of comma separated values
2008-06-11 (first published: 2008-04-29)
1,756 reads
2008-02-13 (first published: 2007-12-18)
1,723 reads
In the simplest terms, a user-defined function (UDF) in SQL Server is a programming construct that accepts parameters, does work that typically makes use of the accepted parameters, and returns a type of result. This article will cover two types of UDFs: table-valued and scalar-valued.
2007-12-12
3,922 reads
Calculates the nth due date for any given date, while accounting for weekends.
2012-05-16 (first published: 2007-10-11)
3,728 reads
Computed columns in SQL Server 2000 allow you to have a calculated value available easily in a query. However by using a function instead of a simple formula you can build some very interesting solutions. New author Tim Chapman brings us a look at this technique.
2006-05-09
21,438 reads
By Kevin3NF
Common Reasons for Emergency SQL calls If you are a production DBA (or Accidental...
By Steve Jones
I grabbed this book over the 2024 holiday season as it was on sale...
By Steve Jones
Investing small amounts of money over a long time works miracles, but no one...
Comments posted to this topic are about the item What is time?
Hello experts, The following SQL update is failing to install on some of our...
where to find information about xE sqlserver.databases_bulk_copy_throughput ? I'm searching for de description of...
Consider the following script for a Sql Server database with Compatibility Level at least 130 (Sql Server 2016):
create table tjson ( id int primary key, j1 varchar(max), j2 varchar(max), j3 varchar(max)); insert into tjson (id, j1, j2, j3) values (1, '[{"c11":"value11A", "c12":"value12A"},{"c11":"value11B", "c12":"value12B"}]', '[{"c21":"value21A", "c22":"value22A"},{"c21":"value21B", "c22":"value22B"}]', '[{"c31":"value31A", "c32":"value32A"},{"c31":"value31B", "c32":"value32B"}]');How many rows does the Query Optimizer estimate for the following query?
select id, c1.c11, c2.c21, c2.c22, c3.c31, c3.c32 from tjson cross apply openjson(j1) with( c11 varchar(50) '$.c11', c12 varchar(50) '$.c12') c1 cross apply openjson(j2) with( c21 varchar(50) '$.c21', c22 varchar(50) '$.c22') c2 cross apply openjson(j3) with( c31 varchar(50) '$.c31', c32 varchar(50) '$.c32') c3;See possible answers