Aggregating Correlated Sub-Queries
Every now and then you may attempt to calculate an aggregate function -- such as SUM() -- on a correlated subquery, only to encounter the following error:
2007-10-29
4,862 reads
Every now and then you may attempt to calculate an aggregate function -- such as SUM() -- on a correlated subquery, only to encounter the following error:
2007-10-29
4,862 reads
Display row value as a TABLE column using SQL select statement
2012-01-12 (first published: 2007-10-26)
4,720 reads
2007-10-25
3,901 reads
2007-10-24
4,730 reads
What is the best way to return the "duration" of an event in SQL, given the start and end datetime values? How can we add up these durations to return grand totals? What data types should be used to return this data to our clients? How do we handle overflows, such as when hours go over 23 or minutes total up to over 59? Are there any T-SQL functions or other techniques that are useful in these scenarios?
2007-10-24
4,455 reads
A look at how constants are used in T-SQL and SQL Server in general along with some suggestions on how better to deal with them.
2007-10-16
7,950 reads
This little script will search for all matching tables on the SQL Server instance
2008-07-30 (first published: 2007-10-15)
749 reads
Sometimes you need to empty the content of database. Following script can do that for you.
2007-10-15
4,867 reads
A function to replace tab characters with the correct number of spaces to align the text as originally intended.
2011-09-29 (first published: 2007-10-11)
2,212 reads
Most DBAs don't ever deal with multiple languages or different collation and sort order settings in SQL Server, but it can be a handy piece of information to have. Steve Jones brings us a quick look at a problem in comparing data across databases.
2007-10-11
11,096 reads
A while back I wrote a quick post on setting up key mappings in...
By Steve Jones
In 100 years a lot of what we take to be true now will...
At Saturday the 21st of February I’m presenting an introduction to dimensional modelling at...
Hello, I inherited a number of tables with like 20-30 column using nvarchar(256) in...
Hi, i'm running vs2022. I'm trying out a c# script that i'd like to...
I upgraded a SQL Server 2019 instance to SQL Server 2025. I wanted to test the fuzzy string search functions. I run this code:
SELECT JARO_WINKLER_DISTANCE('tim', 'tom')
I get this error message:Msg 195, Level 15, State 10, Line 1 'JARO_WINKLER_DISTANCE' is not a recognized built-in function name.What is wrong? See possible answers