T-SQL

SQLServerCentral Article

Calculate Moving Averages using T-SQL in SQL Server

  • Article

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 […]

5 (4)

You rated this post out of 5. Change rating

2020-02-04

22,584 reads

Technical Article

T-SQL script to purge all the tables including foreign key references

  • Script

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.

5 (3)

You rated this post out of 5. Change rating

2019-12-10

2,544 reads

SQLServerCentral Article

SQL Server Name Convention and T-SQL Programming Style

  • Article

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 […]

4.7 (10)

You rated this post out of 5. Change rating

2019-12-10

24,488 reads

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

  • Script

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. 

You rated this post out of 5. Change rating

2019-11-25 (first published: )

740 reads

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

  • Script

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. 

You rated this post out of 5. Change rating

2019-11-12 (first published: )

2,029 reads

Blogs

Monday Monitor Tips: Finding the Hostname for Queries

By

I was chatting with a customer recently and they wanted to know which host...

Can AI Read Execution Plans?

By

Yeah, yeah, second AI post in a row. I promise not to make a...

Streamline Dependency Management in Databases

By

In the intricate world of business, where precision and efficiency are paramount, managing database...

Read the latest Blogs

Forums

SQL Server is terminating in response to a 'stop' request from Service error

By naga.rohitkumar

Dear All, In one of the server its repeatedly restarting sqlserver services and not...

Understanding CROSS APPLY and OUTER APPLY in SQL Server

By Noman072

Comments posted to this topic are about the item Understanding CROSS APPLY and OUTER...

Database Files on Shares I

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Database Files on Shares I

Visit the forum

Question of the Day

Database Files on Shares I

I want to store database files on a file share for a SQL Server 2017 instance. Can I use \\fileserver\D$ as a location?

See possible answers