Handling Aggregations on a Poorly Designed Database
When the database design is not great, you may have to write some creative queries to get what you need.
2020-02-17
3,439 reads
When the database design is not great, you may have to write some creative queries to get what you need.
2020-02-17
3,439 reads
Introduction In Financial Data, analyzing the Moving Average (MA) is a very common practice. The direction of the moving average conveys important information about prices, whether that average is simple or exponential. A rising moving average shows that prices are generally increasing. A falling moving average indicates that prices, on average, are falling. This article […]
2020-02-04
22,031 reads
In this tip we look at a way to minimize the length of blocking using SQL Server lock timeout.
2020-01-24
T-SQL script to purge all the tables including foreign key references. The script has been made smart enough to use TRUNCATE wherever there is no foreign key reference and to use DELETE wherever there is foreign key reference.
2019-12-10
2,492 reads
There are only two hard things in Computer Science: cache invalidation and naming things -- Phil Karlton The recommendations in this article are not the ultimate truth. Please consider this article as a rule template that you can adapt to your needs. A naming convention is a set of rules for choosing the character sequence to […]
2019-12-10
23,982 reads
This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node. The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression.
2019-11-25 (first published: 2019-11-24)
719 reads
This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node. The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression.
2019-11-12 (first published: 2019-11-08)
1,990 reads
T-SQL query to copy the rows of all the tables from one database to another database only if they have rows in Source DB and exact same Schema in both Source and Destination DB.
2019-11-07 (first published: 2019-10-30)
5,279 reads
T-SQL query to return the latest available database backup chain (Full, Differential and Log) of individual databases along with their backup size and compressed size.
2019-11-08 (first published: 2019-10-30)
3,433 reads
With origins from the world of “Submarine ‘Dolphin’ Qualification” questions, an “Oolie” is a difficult question to answer, or the knowledge or fact needed to answer such a question, that may or may not pertain to one's duties but tests one's knowledge of a system or process to the limit. Introduction Contrary to what many […]
2019-08-08
6,178 reads
This month, I prompted bloggers to discuss whether good enough is perfect. Thank you to all...
By Steve Jones
Recently a customer asked if SQL Compare and SQL Data Compare can be used...
I have an application team that is insisting on daily (and for some, weekly)...
i see this in the definition of a linked server on our wh sql...
Is this even possible ? Tried with grant but to no avail. [sys].[database_role_members] and...
What does this code return in SSMS 20 from SQL Server 2019?
select '|' + CHAR(0)+'abc' + '|';See possible answers