As a developer there are times when yo need to convert seconds to minutes, hours and days. The TSQL script mentioned in this article can be used to easily Convert Seconds to Minutes, Hours and Days. Learn How to FORMAT...
Category - SQL Server
Welcome to the ultimate resource for Microsoft SQL Server Database Administration and Development. Our library of expert-led SQL Server tutorials is designed to help you navigate the complexities of enterprise data management, from local development to high-availability production clusters.
Advanced T-SQL Development & Performance Tuning
Master the art of query optimization with in-depth guides on T-SQL enhancements in SQL Server 2016, 2019, and 2022. Learn how to implement high-performance STRING_SPLIT and STRING_ESCAPE functions, utilize DROP IF EXISTS logic for clean deployment scripts, and leverage TRUNCATE TABLE WITH PARTITIONS to manage massive datasets without bloating your transaction logs.
We go beyond basic syntax to show you how to reduce CPU pressure, resolve SQL Server deadlocks, and optimize TempDB contention for maximum throughput.
Mission-Critical DBA Best Practices
Secure your data infrastructure with our proven SQL Server DBA checklists. Our tutorials cover the ‘nuts and bolts’ of database health, including step-by-step SQL Server backup and recovery model configurations, automating SQL Server Agent Jobs, and troubleshooting SQL Server error log 15151 or 18456.
Whether you are looking for SQL Server row count history scripts, configuring Always On Availability Groups, or managing SQL Server Analysis Services (SSAS) backup and restore procedures, MyTechMantra provides the technical clarity needed to maintain 99.9% uptime. Stay updated with the latest SSMS tips, database migration strategies, and SQL Server security hardening techniques to protect your organization’s most valuable asset—its data.
Different Ways to Find Default Trace Location in SQL Server
How to Find SQL Server Default Trace Location Starting SQL Server 2005, Microsoft introduced a light weight trace which is always running by default on every SQL Server Instance. The trace will give very valuable...
SQL Server: How to Find which user deleted the database in SQL Server
Introduction In this article we will take a look at the steps which you can follow to quickly identify the user who deleted the user database in SQL Server. There are two different methods by which one can easily find...
How to Change SQL Server Database Auto Growth Settings
Introduction In this article we will go through the steps to change SQL Server Database Auto Growth Settings. It is always a best practice to set an appropriate auto growth setting for all Production database to a...
How to Repair Suspect Database in SQL Server
There can be a possibility that when you connect to an SQL Server Instance you will find the database being marked as SUSPECT. During such scenarios, you will not be able to connect to the database. Steps to Fix...
Fix Cannot open user default database. Login failed. Login failed for user SQL Server Error
In this article we will take a look at the steps which you need to follow when you receive “Cannot open user default database. Login failed. Login failed for user ‘UserName’. (Microsoft SQL Server, Error: 4064)“ SQL...
Identify Deadlocks in SQL Server Using Trace Flag 1222 and 1204
This article outlines the steps which one can follow to enable Trace Flag 1222 on SQL Server to capture deadlock information. You can also use Trace Flag 1204 in conjunction with Trace Flag 1222. Difference between...
SQL Server Best Practice Auto Close Database Option Should Remain OFF
Introduction In this article, we will take a look at why it is essential to leave AUTO CLOSE database option turned OFF for a Production or a Non-Production SQL Server Database across all versions and editions of SQL...
How to Change Select Top 1000 Rows and Edit Top 200 Rows Default Value in SQL Server Management Studio
How to Select Top 1000 Rows SQL Server Starting SQL Server 2008, SSMS allows you to Select Top 1000 rows and Edit Top 200 rows. However, in the previous version of SSMS 2005, the only option was to open the entire table...
How to Enable and Refresh IntelliSense in SQL Server Management Studio (SSMS)
Introduction In SQL Server 2008, Microsoft had introduced IntelliSense feature in SQL Server Management Studio (SSMS). As a Developer or as a DBA you may face issues with IntelliSense feature not to be working or not...
How to Verify and Register SPN for SQL Server Authentication with Kerberos Connections
Introduction This article explains how to verify and register Service Principal Names (SPN) for SQL Server Authentication with Kerberos Connections. Kerberos Authentication is a widely accepted network authentication...
Drop Database in SQL Server by Killing Existing Connections
DROP Database SQL Server Let’s learn how to Drop Database in SQL Server when the users are connected to the SQL Server Database. You may find the need to close all the existing database connections in a database...
Display Line Numbers in SQL Server Management Studio (SSMS)
SSMS Show Line Numbers | SSMS Line Numbers This article explains how to enable SSMS show line numbers. SHOW Line Numbers in SQL Server Management Studio As a developer you may have often encounter errors while debugging...
How to Move TempDB to New Drive in SQL Server
There are times when as a DBA you find the need to move TempDB Data and Log Files to a new Drive. This article explains all the steps you need to follow to move TempDB files.
FORMAT SQL Server Dates Using FORMAT Function in SQL Server
FORMAT Date in SQL Server FORMAT Function was introduced in SQL Server 2012, and it is available in all the later versions of SQL Server. This article will show different examples of using the new FORMAT function in SQL...
