Category Archives: T-SQL

New SQL Server 2016 Online Alter column

Over the few months i have been playing with SQL Server 2016 new features. Microsoft SQL Server 2016 introduced new alter column with ONLINE option. Let’s explore this. Create a table and insert data    Find what page has been allocated … Continue reading

Posted in Database Administration, SQL Server 2016, T-SQL | Leave a comment

Script to find failed sql agent jobs and notify via email

This is one of the useful script to check and find failed jobs on sql server every day and send notification via email.   Cheers Hope you like the post! Ramasankar Molleti LinkedIn: LinkedIn Profile Twitter: Twitter  

Posted in Database Administration, T-SQL | Leave a comment

New SQL Server 2016 Truncate Table With Partitions

I have a table with different partitions and would like to truncate rows in the particular partitions in a table rather than truncating whole table. How can we do this? This task is fairly easy in sql server 2016. Microsoft introduced … Continue reading

Posted in T-SQL | Leave a comment

Database size report for multiple database on multiple servers

As a DBA, you are responsible for monitoring the growth of the databases on multiple servers in different environments. There are many ways we can achieve this, my requirement was to use linked servers to get the databases size of all the … Continue reading

Posted in T-SQL | Leave a comment

T-SQL Script to find Free space By Database

This is one of the handy script to find the free space by each database. This is useful when you troubleshoot the database space issues. Hope you enjoyed the post! Cheers Ramasankar Molleti LinkedIn: LinkedIn Profile Twitter: Twitter      

Posted in T-SQL | Leave a comment

Merge Statement to perform insert , update and delete in one statement

This example, demonstrate how to perform insert, update and delete on single statement using MERGE. If you are a Database Developer/BI expert, you would need to refresh the target table to match the source tables periodically. Prior to SQL Server … Continue reading

Posted in T-SQL | Leave a comment