Tag Archives: tsql

Validate and delete duplicate records from MSSQL table

I had a situation where Index creation failed and business wants to delete duplicate entries immediately from a specific table. I had to validate the columns which are unique and which had different values. Following is easy script to validate … Continue reading

Posted in SQL, SQL Query, Uncategorized | Tagged , , , | Leave a comment

Availability Group Fail Over date/time – TSQL

I have been using this quick script to verify AG Status Change details from error log.

Posted in High Availability, SQL, SQL Query, SQL Server, Uncategorized | Tagged , , , , , | Leave a comment

Interesting observation with DATETIMEOFFSET data type in SQL

Calculating daily max values of a table will be different if you are using/storing the data in DATETIMEOFFSET format. Basic difference is, while comparing the data between DATETIMEOFFSET and DATE (or DATETIME), DATETIMEOFFSET value will be converted to UTC and … Continue reading

Posted in Script, SQL, SQL Query, Uncategorized | Tagged , , , , | Leave a comment

TSQL to find users and their access on a given database

TSQL to find users and their access on a given database

Posted in Script, SQL, SQL Query, Uncategorized | Tagged , , , | Leave a comment

Find Drive size and free space using TSQL

Posted in SQL, SQL Query | Tagged , , , , | Leave a comment

TSQL – Monitor to check number of records every hour in a given table

Posted in Azure, SQL, SQL Query, Uncategorized | Tagged , , , | Leave a comment

TSQL to start a SQL job and check all running jobs

Posted in commands, Productivity, SQL, SQL Query, Uncategorized | Tagged , , , , | Leave a comment