Stored Procedure to Delete Duplicate Records in SQL Table
Sometimes during our run as DBAs, we come up across at least one table that is loaded with...
What is a Materialized View and Why Should you Use It?
As data volumes continue to increase, more developers look towards materialized views to process queries. This approach has a lot of...
How to Write Complex Queries in SQL
Typical queries in the SELECT * FROM table format are sometimes not enough. When the data for a query is not in one table, but in several,...
SQL Stuff Function
The main idea around the SQL Server function called STUFF is concatenating multiple columns into a...
A Simple Use Case for Indexes on Primary Keys
Introduction Recently we encountered an interesting performance problem on one of our SQL Server databases that process transactions at a...
Hash What? Understanding Hash Indexes
Hash indexes are an integral part of databases. If you’ve ever used a database, chances are that you have seen them in action without...
How to Find SQL Server Instance Name and More with Stored Procedures
SQL Server instances serve as the backbone of a business model, housing databases that contain...
Execute Dynamic Query in SQL Server
Dynamic SQL is a statement constructed and executed at runtime, usually containing dynamically generated SQL string parts, input...
How to Create a Table with Multiple Foreign Keys and Not Get Confused
Understanding Table Relations SQL server adds foreign keys to implement relations between tables in a relational database. A table can have...
How to Get Backup Status in SQL Server using Stored Procedure
Any SQL Server DBA (of course, this applies to all platforms) will agree that database backups are...