Introduction 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 before...
How to Export records from SQL Server to Text File using BCP Command
Introduction Is there a quick way to export records from SQL Server to text file? In this tip we will take a look at an example to export records from SQL Server to text file using BCP. In this tip we will learn how to...
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...
Fix Cannot open user default database. Login failed. Login failed for user SQL Server Error
Introduction 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:...
SQL Server: How to Start SQL Server in Single User Mode?
Introduction 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...
2 Signs you need to migrate to SharePoint 2016 and how to nail the upgrade
Reasons to Migrate to SharePoint 2016? Debates on migrating SharePoint solutions to its 2016 version started even before the version was officially released. All the stir is basically about the assertive promotion of...
Display Line Numbers in SQL Server Management Studio (SSMS)
As a developer you may have often encounter errors while debugging TSQL code. SQL Server will show you an error message referencing you to a particular line number where the syntax error has occurred. This tip explains...
How to Enable & Disable XP_CMDSHELL using SP_CONFIGURE in SQL Server
Introduction In this tip we will take a look at the step to follow to enable or disable XP_CMDSHELL using SP_CONFIGURE system stored procedure. In order to use XP_CMDSHELL you need to be a system administrator. Read the...
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...
Identify Deadlocks in SQL Server Using Trace Flag 1222 and 1204
Introduction 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...
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.
How to Change Select Top 1000 Rows and Edit Top 200 Rows Default Value in SQL Server Management Studio
Introduction 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. Let us see how to alter...
Download SQL Server 2016 Developer Edition for Free
Introduction Microsoft announced the release of the Release to Manufacturing (RTM) version of SQL Server 2016 on June 1, 2016. The good news is that you can download SQL Server 2016 Developer Edition for Free. Different...
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...
Convert Seconds to Minutes, Hours and Days in SQL Server
Introduction The TSQL script mentioned in this article can be used to Convert Seconds to Minutes, Hours and Days in SQL Server. /* Example: Where Time Is Given In Seconds Output: In “Day(s) : Hour(s) : Minute(s) :...
SQL Server SIMPLE Recovery Model Step by Step Tutorial with Examples
Introduction SIMPLE recovery model as the name suggests it is the most basic recovery model which is available in SQL Server. In this recovery model every transaction is written to the transactional log file and once...