When the database design is not great, you may have to write some creative queries to get what you need.
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 […]
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.
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 […]
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.