SQL Delete Duplicate Rows from a SQL Table in SQL Server There are scenarios when you need to DELETE Duplicate Rows in SQL Server Table or REMOVE Duplicate Rows in SQL Table. Deleting Duplicate Records from...
Author - Ashish Mehta
COVID-19 Dashboard
Coronavirus (COVID-19) Dashboard provides an overview of its impact. The dashboard also includes the total number of cases reported by each country. Data is refreshed automatically. COVID-19 Vaccination Status...
Does SQL Server Database Use Any Enterprise Edition Features?
One of the most common tasks performed by the DBA is to moving user databases across different editions of SQL Server especially during Disaster Recovery Situations. There are some Enterprise Edition only features which...
Discover SQL Server Components Installed Using SQL Server Discovery Tool
Microsoft Introduced SQL Server Discovery Tool is widely used by SQL Server Database Administrators to quickly identify SQL Server Components which are already installed on a local SQL Server. The report shown in the...
Different States of SQL Server Database
SQL Server Database can reside in one among the seven states. For example these can be ONLINE, OFFLINE, RESTORING, EMERGENCY, SUSPECT etc. This article explains each of these states and includes a T-SQL code which can...
How to Get SQL Server Instance Information
In this article we will take a look at different ways in which a DBA or a Developer can Retrieve System and SQL Server Information. The method mentioned is applicable for SQL Server 2005 and all higher versions. Below...
How to Use SQL Server Configuration Manager
How to Use SQL Server Configuration Manager to Manage SQL Server Services, Configure Network Protocols, and Network Connectivity Configuration “SQL Server Configuration Manager” is a tool that can be used to...
How to Manage SQL Server Failover Cluster using Command Line
In this article we will take a look at how to manage SQL Server Failover Cluster Using Command Line. If you are managing multiple clusters then the following article will be of help How to Identify SQL Server...
How to Identify SQL Server Cluster Node and Shared Drives Information Using TSQL Queries
When you have a Multiple SQL Server Cluster Configuration and multiple shared drives it becomes tough to know which SQL Server Failover Cluster Instance is using which Shared Drives. This article has the collection of...
How to Identify CPU Bottlenecks in SQL Server Using Performance Counters
There are instance when you are facing CPU bottlenecks on your SQL Server Instance. In this article we will take look at How to Identify CPU Bottlenecks in SQL Server Using Performance Counters.The most common reason...
Improved Startup Parameters in SQL Server 2012
Microsoft has improved the configuration of startup parameters in SQL Server 2012 and it is much simpler and easier. In this article we will take a look at the steps to add a Trace Flag 1222 to identify deadlocks in SQL...
SQL Server Database Engine Service Startup Options
SQL Server Database Engine supports different startup options for SQL Server Database Engine Service. A database administrator can set the startup options very easily using SQL Server Configuration Manager. In this...
How to Uninstall SQL Server 2008 Step by Step Guide
This article is a step by step guide which can be used by database administrators to Uninstall SQL Server 2008 Enterprise Edition. Step by Step Guide to Uninstall SQL Server 2008 / 2008 R2 Step 1: Click Start | Control...
SQL Server WHERE Clause T-SQL Tutorial with Examples
The WHERE Clause is used to fetch records from a table which meets the condition mentioned in the WHERE Clause. This is Part 5 of 40 Part SQL Server T-SQL Tutorial. Click here to read it from the beginning…. WHERE...
SQL Server ORDER BY Clause T-SQL Tutorial with Examples
The ORDER BY Clause is used to order the result set in ascending or descending order. By default, when ORDER BY clause is used the result set is ordered in the ascending order. This is Part 4 of 40 Part SQL Server T-SQL...
SQL Server SELECT DISTINCT Clause T-SQL Tutorial with Examples
The SELECT DISTINCT Statement is used to fetch distinct values in a specific column of a given table. This article gives you an overview of the SQL Server SELECT DISTINCT clause or SELECT DISTINCT SQL Clause. This is...
SQL Server SELECT TOP Clause T-SQL Tutorial with Examples
The SELECT TOP Clause is used to specify the percentage of rows or to specify the number of rows which needs to be retrieved from a given table. This is Part 2 of 40 Part SQL Server T-SQL Tutorial. Click here to read it...
SQL SELECT | SQL QUERY | SQL SELECT Statement T-SQL Tutorial with Examples
SQL SERVER SELECT Statement | SQL SELECT TABLE | SQL SELECT | SQL QUERY The “SQL SELECT statement” is used to select data from a database. In SQL SERVER, the SELECT Statement is used to query the data stored...
Database Backup Encryption in SQL Server 2014 a Step by Step Implementation Guide
Microsoft has introduced inbuilt Database Backup Encryption Feature in SQL Server 2014. Starting SQL Server 2014, SQL Server will have the ability to encrypt the data while the backup is in progress. One can encrypt the...
How to Restore Database in SQL Server?
Summary This article mentions different methods to restore the database in SQL Server from the backup files (.bak files). You can RESTORE a database from a backup file using SQL Server Management Studio (SSMS) or...
How to Repair Database in Suspect Mode in SQL Server
Summary There are times when you connect to an SQL Server Instance you will find the database being marked as SUSPECT. In such a scenario, you will not be able to connect to the database to read and write data...
Identify Deadlocks Using Graphical Deadlock Chain Event in SQL Server Profiler
This article explains how to identify deadlocks in SQL Server using graphical deadlock chain event in SQL Server Profiler. We would highly recommend you to read “Identify Deadlocks in SQL Server Using Trace Flag 1222...
How to Monitor Transaction Log File Usage in SQL Server
As a Best Practice database administrator should always monitor the space usage within the SQL Server Transaction Log file. This will help you quickly understand how much space the Transaction Log file is using during...
Why to Configure Database Instant File Initialization in SQL Server? Advantage
Why to configure Database Instant File Initialization in SQL Server? Its Advantages SQL Server Database Administrators can leverage Database Instance File Initialization Feature which is available in Microsoft Windows...
Different Ways to Enable Dedicated Administrator Connection in SQL Server
Microsoft introduced Dedicated Administrator Connection (DAC) feature in SQL Server 2005 and higher versions. Using DAC feature a database administrator can connect to an SQL Server Instance when SQL Server stops...
Steps to Connect to SQL Server When all System Administrators are Locked Out
Getting Sysadmin Access to SQL Server When Locked Out SQL Server Security is one of the key responsibilities of a Database Administrator. However, there can be scenarios when a DBA will be asked to manage SQL Server...
How to Backup and Restore Resource Database in SQL Server
Microsoft SQL Server 2005 introduced a new system database namely Resource database. It’s a read-only system database which is hidden from users and in this article we will discuss how to backup and restore Resource...
How to Detect Virtual Log Files in SQL Server Transaction Log File
This article demonstrates how to Detect Virtual Log Files in SQL Server Transaction Log File. The steps mentioned in this article are applicable on SQL Server 2005 and higher versions. To know more about how to fix...
What are Virtual Log Files in SQL Server Transaction Log File?
Every transaction log file is logically divided into smaller segments and these segments are called Virtual Log Files or VLFs. VLF stands for Virtual Log File in SQL Server Transaction Log File How Virtual Log Files...
Why Model Database Default Settings Customization is Important for SQL Server?
What is a Model System Database? Model is a system database which is used as a template while creating newer user databases in SQL Server. Why you must make necessary changes to default settings of a Model System...
Where can I find SQL Server Management Studio for SQL Server 2016?
After the successfully installation of SQL Server 2016, I have realized that SQL Server Management Studio 2016 (SSMS) is missing. In this tip we will discuss how to download and install SQL Server Management Studio for...
Limit SQL Server Error Log File Size in SQL Server
SQL Server Error Log contains valuable information which can be used by database administrators to troubleshoot issues with SQL Server. A typical Error Log file contain informational messages, warnings, critical events...
How to Identify the Location of Resource Database in SQL Server
In this article we will take a look at how to identify the location of Resource database in SQL Server using a TSQL script. Importance of Resource Database in SQL Server Microsoft initially introduced Resource database...
SERVERPROPERTY Function T-SQL Enhancement in SQL Server 2016
SERVERPROPERTY is an inbuilt function which gives you information about the server instance. Learn How To Get SQL Server Info Using SERVERPROPERTY Function in SQL Server. This is Part 10 of 10 Part T-SQL Enhancements in...
STRING_SPLIT Function and STRING_ESCAPE Function in SQL Server 2016
SQL Server 2016 introduces two new string functions namely STRING_SPLIT and STRING_ESCAPE. This is Part 8 of 10 Part T-SQL Enhancements in SQL Server 2016 for Developers and DBAs. Click here to read it from the...
COMPRESS and DECOMPRESS T-SQL Enhancement in SQL Server 2016
SQL Server 2016 introduces two new system functions namely COMPRESS and DECOMPRESS. This is Part 7 of 10 Part T-SQL Enhancements in SQL Server 2016 for Developers and DBAs. Click here to read it from the beginning…...
ALTER DATABASE SET AUTOGROW_ALL_FILES T-SQL Enhancement in SQL Server 2016
SQL Server 2016 introduces two new options to ALTER DATABASE statement which can be used to modify database files namely AUTOGROW_SINGLE_FILE and AUTOGROW_ALL_FILES. In the earlier versions of SQL Server...
ALTER DATABASE SET AUTOGROW_SINGLE_FILE T-SQL Enhancement in SQL Server 2016
SQL Server 2016 introduces two new options to ALTER DATABASE statement which can be used to modify database files namely AUTOGROW_SINGLE_FILE and AUTOGROW_ALL_FILES. In the earlier versions of SQL Server...
MAXDOP for DBCC CHECKDB, DBCC CHECKTABLE and DBCC CHECKFILEGROUP T-SQL Enhancement in SQL Server 2016
SQL Server 2016 brings MAXDOP settings, for DBCC CHECKDB, DBCC CHECKTABLE and DBCC CHECKFILEGROUP command. Database Administrators can leverage MAXDOP settings to above mentioned DBCC commands to achieve Max Degree of...
ALTER TABLE WITH (ONLINE=ON | OFF) T-SQL Enhancement in SQL Server 2016
SQL Server 2016 introduces an interesting T-SQL enhancement to improve performance and reduce downtime ALTER TABLE WITH (ONLINE = ON | OFF). This statement will help you alter data types, change column/table collation...
DROP IF EXISTS SQL Server T-SQL Enhancement in SQL Server 2016
DROP IF Exists SQL Server | DROP IF Exists Table | DROP IF Exists Procedure SQL Server 2016 introduces a new DROP IF EXISTS SQL Server statement to DROP objects such as tables, columns, indexes, stored procedures...
TRUNCATE TABLE WITH PARTITIONS T-SQL Enhancement in SQL Server 2016
Truncate Table WITH Partitions SQL Server | Truncate Table SQL Server | It is a well known fact that TRUNCATE TABLE is faster than DELETE statement. TRUNCATE TABLE SQL Server uses lesser system resources and transaction...
How to Enable an Index in SQL Server
In this article we will take a look at how to enable an index in SQL Server. This is a very useful feature which will help you enable an index which was disabled earlier to check whether the index was really useful or...
How to Disable an Index in SQL Server
In this article we will take a look at how to disable an index in SQL Server. This is a very useful feature which will help you identify whether the index is really useful or not without actually dropping the index...
How to Change SQL Server Login Properties to Enforce Password Policies and Expiration Settings
How to set SQL Server Password Policy | Set SQL Password Policy This article demonstrates the steps to create an SQL Server Login which enforces password policies and password expiration policies. Let us start by...
Troubleshooting The remote procedure call failed. [0x800706be] WMI Error in SQL Server
You may end up getting “The remote procedure call failed. [0x800706be] WMI Error“ when you click SQL Server Services in SQL Server Configuration Manager as shown in the snippet below. This article explains the steps to...
How to Start SQL Server in Single User Mode?
There can be certain scenarios when one needs to connect to an SQL Server Instance in a Single User Mode by using the Startup Option -m. For example, the need could be to recover a damaged system database such as...
SQL Server: How to Start SQL Server with Minimal Configuration
Introduction There can be certain scenarios when SQL Server is not starting because of configuration problems. During such scenarios one need to start an instance of SQL Server by using minimal configuration...
Configure Network Drive Visible for SQL Server During Backup and Restore Using SSMS
Introduction Most of the Development and Test Database Servers will not have enough disk space to store both the database and backup files in order to perform the periodic database refreshes. In such scenarios, the best...
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...
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...
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...
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...