SQL SERVER – Installation failed with error – Wait on the Database Engine recovery handle failed

You might have seen on Facebook that I have completed the new setup of my machines. Since I use VMs to do my tests. To have a domain, I made a VM as domain controller and another as a member server. Next step was to install SQL Server and by mistake, I have run the setup of SQL on a domain controller. As per Microsoft documentation they don’t recommend installing SQL on the domain controller and there is a warning in SQL Setup.

setup dc 01 SQL SERVER   Installation failed with error   Wait on the Database Engine recovery handle failed

Rule Check Result
Rule “Computer domain controller” generated a warning.
Installing SQL Server 2016 CTP2.4 on a domain controller is not recommended.
I proceeded further and it failed at the end with below error
Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
Here is the complete message in summary.txt file.
Feature:                       SQL Server Replication
Status:                        Failed: see logs for details
Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Component name:                SQL Server Database Engine Services Instance Features
Component error code:          0x851A001A
Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
I followed the error message as it asked to check ERRORLOG. Here is message in ERRORLOG
Error: 17190, Severity: 16, State: 1.
Initializing the FallBack certificate failed with error code: 1, state: 20, error number: 0.
Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate.
Error: 17182, Severity: 16, State: 1.
TDSSNIClient initialization failed with error 0x80092004, status code 0x80. Reason: Unable to initialize SSL support. Cannot find object or property.
Error: 17182, Severity: 16, State: 1.
TDSSNIClient initialization failed with error 0x80092004, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. Cannot find object or property.
Error: 17826, Severity: 18, State: 3.
Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
Error: 17120, Severity: 16, State: 1.
SQL Server could not spawn FRunCommunicationsManager thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.

I searched on the internet and found that this could be issued with a SQL Service account. I selected all default configuration and it was NT Service\MSSQLServer

I uninstalled SQL Server and this time I selected Local System account for SQL Service in setup wizard and voilà it went fine.

Have you ever faced any such error on a regular machine? What was the solution?

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – Backup to Azure Blob error – The remote server returned an error: (409) Conflict

Cloud is inevitable. With various innovations happenings in this area, SQL Server is not left behind. It is becoming a first class citizen when it comes to moving to cloud. In the past couple of releases, we have been seeing the enhancements of integrating with Azure getting stronger. Last year I wrote a blog about taking backup directly to Azure Storage.

SQL SERVER – Backup to Azure Blob using SQL Server 2014 Management Studio

As part of a demo environments, I configured it long back and recently I stated seeing failures of backup in ERRORLOG and found below error message.

2015-04-03 15:39:12.40 spid165     Error: 18210, Severity: 16, State: 1.
2015-04-03 15:39:12.40 spid165     BackupVirtualDeviceFile::DetermineFileSize: SetPosition(0,EOF) failure on backup device ‘https://sqlauth.blob.core.windows.net/backups/SQLATHTEST_da634d4074d9451591fe99d6e6981f83_20150331160324-07.log’. Operating system error Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: (409) Conflict.

I searched for the ways to fix this error and landed across MSDN article which asked to enable trace flag 3051 to get additional details.

DBCC TRACEON (3051,-1)

Once I ran the command and ran the back-up again, it failed but there was an additional file generated in the same folder which has ERRORLOG. Here is the content

11/10/2015 3:39:15 PM: ======== BackupToUrl Initiated =========
11/10/2015 3:39:15 PM: Inputs: Backup = False, PageBlob= True, URI = https://sqlauth.blob.core.windows.net/backups/SQLATHTEST_da634d4074d9451591fe99d6e6981f83_20150331160324-07.log, Acct= sqlauth, FORMAT= False, Instance Name = MSSQLSERVER, DBName = SQLAUTHTEST LogPath = D:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Log
11/10/2015 3:39:15 PM: Process Id: 7384
11/10/2015 3:39:15 PM: Time for Initialization = 9.0003 ms
11/10/2015 3:39:15 PM: BackupToUrl Client is getting configuration from SqlServr
11/10/2015 3:39:15 PM: Time for Handshake and VDI config = 10.0001 ms
11/10/2015 3:39:15 PM: Time for Get BlobRef = 0.9949 ms
11/10/2015 3:39:16 PM: An exception occurred during communication with Azure Storage, exception information follows
11/10/2015 3:39:16 PM:  Exception Info: The remote server returned an error: (409) Conflict.
11/10/2015 3:39:16 PM:  Stack:    at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase`1 cmd, IRetryPolicy policy, OperationContext operationContext)
at Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob.AcquireLease(Nullable`1 leaseTime, String proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)

If we look at stack it talks about lease. 409 conflict – Indicates that the request could not be processed because of conflict in the request, such as an edit conflict in the case of multiple updates.

I downloaded Azure Explore tool from http://www.cerebrata.com/products/azure-explorer/introduction and using the tool I was able to break lease which was open. Below is the option in the UI called ‘Break Lease On Blob’ once you are connected to the Storage account.

lease 01 SQL SERVER   Backup to Azure Blob error   The remote server returned an error: (409) Conflict

Another way was to break the lease using the way documented in MSDN https://msdn.microsoft.com/en-us/library/jj919145.aspx (Deleting Backup Blob Files with Active Leases) and it needs coding which I am not an expert at.

Have you ever tried using backupToURL option with SQL Server? Will you be using these tools for your environments? Do let me know via comments.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – What is T-SQL Window Function Framing? – Notes from the Field #102

Kathi SQL SERVER   What is T SQL Window Function Framing?   Notes from the Field #102[Note from Pinal]: In this episode of the Notes from the Field series database expert Kathi Kellenberger explains about T-SQL Over clause. Kathi is an amazing instructor, she was the SQL author I have read in my early career. The reason, I love SQL Server because her writing has instigated love for this technology in me. Today she brings a relatively interesting topic for database experts. Read the experience of  Kathi in her own words.

One of the best kept secrets of T-SQL window functions, also called windowing or windowed functions, is framing. Framing was introduced with SQL Server 2012, and it allows the set of rows, or window, to be defined very granularly. For example, when calculating a running total, each row needs to see an increasing number of values to perform the calculation. Row 1 needs to see just row 1. Row 2 needs to see rows 1 and 2. Row 3 needs to see rows 1, 2, and 3. Framing allows each row to have a distinct set of rows for the window function calculation.

NOTE: In my last SQL Authority post, I explained the OVER clause. Be sure to review that article if the OVER clause is new to you.

Framing is used in a very specific set of circumstances: with accumulating window aggregates and with FIRST_VALUE and LAST_VALUE. Accumulating window aggregates are the aggregate functions you use every day along with an OVER clause containing an ORDER BY. You can calculate a running total, for example. FIRST_VALUE lets you pull in any column from the first row of the frame. LAST_VALUE lets you pull in any column from the final row of the frame. By default, if you don’t specify the frame in the OVER clause when it is supported, it will consist of the rows starting with row 1 of the partition and continue to the current row. Often, the default frame will give you the results you are looking for. By explicitly specifying the frame, you can achieve even more functionality, avoid some logical errors, and get better performance.

Framing has several keywords you should learn.

Table 1 lists each one.

Term Definition
ROWS A positional operator used to define the frame.
RANGE A logical operator used to define the frame. This operator is not fully implemented as of SQL Server 2014. It is the default frame type.
CURRENT ROW The row where the result of the calculation will be returned and also used as a boundary.
UNBOUNDED PRECEDING The first row of the partition, often used as the lower boundary.
UNBOUNDED FOLLOWING The final row of the partition, often used as the upper boundary.
# PRECEDING A number of rows before the current row, often used as the lower boundary. This is only supported with ROWS.
# FOLLOWING A number of rows following the current row, often used as the upper boundary. This is only supported with ROWS.
BETWEEN Used to connect the two boundaries.

Table 1: Framing terms

Here is the default frame, when one isn’t specified:


This means that the rows in the window will consist of the first row of the partition and continue to the current row. This works for calculating a running total as long as the ORDER BY columns found in the OVER CLAUSE are unique. If not, because RANGE evaluates the data logically, you can get results that don’t make sense.

When I speak on this topic, I tell my audience they need to learn three things: Use ROWS. Use ROWS. And use ROWS. Instead of relying on the default frame, to calculate a running total, use this frame:


If that is too much to type, you can also abbreviate it like this:


If you would like to calculate a three month moving average, for example, use this frame:


I’ll save the performance differences for another post, but I would like to show you some logical problems found by leaving out the frame. This example runs in the AdventureWorks database. The ORDER BY column is not unique, and I have chosen a customer with multiple orders on the same date.

SELECT CustomerID, SalesOrderID, CAST(OrderDate AS Date) AS OrderDate, TotalDue,
SUM(TotalDue) OVER(ORDER BY OrderDate
) AS RunningTotal,
SUM(TotalDue) OVER(ORDER BY OrderDate) AS DefFrameRunningTotal,
FIRST_VALUE(SalesOrderID) OVER(ORDER BY OrderDate) AS FirstOrder,
LAST_VALUE(SalesOrderID) OVER(ORDER BY OrderDate) AS DefFrameLastOrder
FROM Sales.SalesOrderHeader
WHERE CustomerID = 29586
ORDER BY OrderDate;

Here are the results:

102 1notes SQL SERVER   What is T SQL Window Function Framing?   Notes from the Field #102

Take a look at the RunningTotal column. The value increases until you get to the final row. The correct frame is specified the OVER clause. Take a look at the values in DefFrameRunningTotal. Notice that, instead of continually increasing, it repeats values. This problem is due to the default frame, using RANGE, which looks at the value of OrderDate instead of just the position of the row. If the OrderDate values are the same, then they belong together in the same window when RANGE is used. You can solve this problem by using ROWS or by making sure that the ORDER BY expression in the OVER clause is unique. (Use ROWS. Use ROWS. And use ROWS.)

Take a look at the FirstOrder column. In each case, the value returned came from the first row of the partition. Even without specifying the frame, it works correctly. The LastOrder column looks correct as well. Notice that I specified a frame with ROWS that starts with the current row and goes up to the end of the partition. When leaving out the frame as shown in DefFrameLastOrder, the results don’t make much sense at all. Remember, the default frame only goes up to the current row. But since RANGE is a logical operator, it actually will go to a row with the same ORDER BY value as the current row. By default, the frame doesn’t go all the way to the end of the partition where the last value can be found. To correctly use LAST_VALUE, you must specify the frame, and you should use ROWS.

Table 2 lists commonly used frames:

Frame Meaning
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW Start at row 1 of the partition and include rows up to the current row.
ROWS UNBOUNDED PRECEDING Start at row 1 of the partition and include rows up to the current row.
ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING Start at the current row and include rows up to the end of the partition.
ROWS BETWEEN N PRECEDING AND CURRENT ROW. Start at a specified number of rows before the current row and include rows up to the current row.
ROWS BETWEEN CURRENT ROW AND N FOLLOWING Start at the current row and include rows up to a specified number of rows following the current row.
ROWS BETWEEN N PRECEDING AND N FOLLOWING Start at a specified number of rows before the current row and include a specified number of rows following the current row. Yes, the current row is also included!

Table 2: Commonly used framing syntax

Specifying the correct frame is really important to ensure that you achieve the expected results. There are also some important performance differences which I’ll talk about in my next SQL Authority post.

notes 82 3 SQL SERVER   What is T SQL Window Function Framing?   Notes from the Field #102If you would like to learn more about T-SQL window functions, be sure to check out my latest book Expert T-SQL Window Functions in SQL Server or my Pluralsight course T-SQL Window Functions.

If you want to get started with SQL Server with the help of experts, read more over at Fix Your SQL Server.

Reference: Pinal Dave (http://blog.sqlauthority.com)

SQL SERVER – What is SQL Server Operating System?

sqlos SQL SERVER   What is SQL Server Operating System?Sometimes the strangest of questions come from unusual places. This blogging journey is all about revisiting the basics. I have always felt getting some of these basic questions can make us learn even more and look into the internals of how products work. In my recent visit to SQLPass and on one of my book signing times, one of the attendees walked up to me and said do you know about the SQL Server Operating System? I was surprised because it didn’t strike to me at first shot. I went ahead to ask – “What do you mean sir? Where did you see it?”. The reply was – “I read your wait stats book and when I was looking at the DMVs for wait stats, I saw something with SOS* event. I searched the internet to find out it was SQL Server OS. So what is this OS?”. I was pleasantly relieved to hear it because I checked this blog because I couldn’t find anything.

This blog is all about explaining some of the functions of SQLOS and what it is not to be assumed as. The SQL Operating System (SQLOS) was introduced in SQL Server 2005. SQLOS is a very thin abstraction layer. SQLOS is NOT:

  1. A wrapper for Operating System APIs.
  2. A bridge to other Operating Systems. The SQLOS does not allow us to port to other operating systems. That is not the intent of the SQLOS.
  3. A shared component library. For a matter of fact, each instance of SQL Server has its own SQLOS. So if you have 2 instances of SQL installed each instance has its own SQLOS.

In reality, the SQLOS performs the following critical functions for SQL Server:

  1. Scheduler and IO completion. The SQLOS is responsible for scheduling threads for CPU consumption. Most threads in SQL Server are run in cooperative mode, which means the thread is responsible for yielding so that other threads can obtain CPU time. Most IO is asynchronous.  The SQLOS is responsible for signaling threads when IO is completed.
  2. Synchronization primitives: SQL server is a multi-threaded application, so SQLOS is responsible for managing thread synchronizations.
  3. Memory management: Different components within SQL Server, example plan cache, CLR, lock manager etc request memory from the SQLOS. Therefore, the SQLOS can control how much memory a component within SQL Server is consuming.
  4. Deadlock detection and management of the same.
  5. Exception handling framework.
  6. Hosting services for external components such as CLR and MDAC. SQL Server will run threads that are associated with external component in preemptive mode. Preemptive mode allows the SQLOS to prevents runaway threads (threads which will not yield and allow other threads to get CPU execution). Also the SQLOS can keep track of the memory these external components consume. For example, for CLR the SQLOS can invoke garbage collection if the CLR process is taking up too much memory.

As you can see, SQLOS seems to be a great resource management capability as it makes sure the SQL Server instance can be always up and running.

As I wrap up this blog, I am interested in knowing if you ever encountered SOS related waits on your environments? What were the values and what have you done to mitigate the same? Would like to learn from you on these outliers.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – Understanding SQL Server Setup Support Rules for Cluster Nodes

SQL Server clustering is one of the oldest and most used techniques when it comes to developing a highly available configuration. Though this has been used by many for years, there are nuances that comes up once in a while if you are a junior DBA that you would like to validate your understanding. In one such mails that landed to my Inbox asked what are the significance of the various rules we validate when configuring a cluster. The mail was for SQL Server 2008 edition but this seemed simple yet no one seemed to have written about it.

On this Landing page of the Cluster Global Rules in SQL Server, this is a set of 11 Rules. We only run validation on the node we are doing the setup on. Just as we can understand, some of the rules are critical rules and others are merely optional rules. I am outlining based on what I received from my reader as questions:

  1. Fusion Active Template Library (ATL): Checks if a computer restart is required because of broken fusion ATL. A pending restart can cause SQL Server Setup to fail.
  2. Unsupported SQL Server Products: Checks whether SQL Server 7.0 or SQL Server 7.0 OLAP Services is installed. SQL Server 2008 is not supported with SQL Server 7.0.
  3. Not Clustered or the cluster service is up and online: Verifies that the computer is not clustered or that the computer is clustered and the cluster service is online.
  4. Windows Management Instrumentation (WMI) Services (“Node Name”) – Local Node: Checks whether the WMI service is running on the cluster because Setup is dependent on this service.
  5. Cluster Remote Access (“Node Name”) – Local Node: Checks whether the user running this Setup operation has remote access on the remote cluster node(s).
  6. Remote registry service (“Node Name”) – Remote Node: Checks whether the Remote Registry service is enabled.
  7. Domain Controller: Checks if the computer is a Windows Domain controller.
  8. Microsoft .NET Application Security: Verifies that the computer is connected to the Internet. When a Microsoft .NET application like Microsoft Management Studio starts, there may be a slight delay while the .NET security check validates a certificate.
  9. Network binding order: Checks to see if the computer domain server is on the network that is bound to the top of the network order.
  10. Windows Firewall: Checks whether the Windows Firewall is enabled.
  11. DNS settings (“Node Name”) – Local Node: Checks if the DNS search list on computer (“Node Name”) is consistent with the other nodes of a cluster.

I am sure, the number of checks might get expanded or shrunk based on the version of SQL Server we are working on. I am glad I could demystify some of the basics to junior DBA who posted this question to me. I am curious to understand to how many actually look though the list of rules ever? Do you know what were the various rules that were run on the setup? Let me know your thoughts.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – Save and Send Execution Plan Via Email

Here is an interesting question, I received the other day.

Hi Pinal,

I have a very big graphical execution plan and I want to send it to my friend. My first thought was to send him query to execute on his own machine, but he does not have the same database which I am using. I also do not want to send my large database to him.

How can I save the execution plan to my computer and send it to him via email? Additionally, my email support only maximum of 20 MB, so please also guide me, what should I do if the size goes over 20 MB?


It is indeed a very interesting question. Here is the simplest way to do what the user is asking in the email.

Here is a quick tutorial.

Step 1: You can write any query and click on the icon on the top tool bar or type shortcut CTRL+M to enable actual management studio.

exec1 SQL SERVER   Save and Send Execution Plan Via Email

Step 2: Click on Execute Query

exec2 SQL SERVER   Save and Send Execution Plan Via Email

Step 3: It will execute the query and will bring up Execution Plan Tab. Click on the Execution Plan Tab.

exec3 SQL SERVER   Save and Send Execution Plan Via Email

Step 4: Upon clicking on Execution Plan it will bring up a query execution plan. Right Click over here and it will bring up a menu. In this menu click on the Save Execution Plan As…

exec4 SQL SERVER   Save and Send Execution Plan Via Email

Step 5: You can save your file with the extension.sqlplan.

exec5 SQL SERVER   Save and Send Execution Plan Via Email

That’s it! You are done. Now you can send the sqlplan via email to anyone. When someone opens the file, it will open in SQL Server Management Studio as displayed in the following image. The user has no need to have any database on their system. They can just see the data fine in the sqlplan.

exec6 SQL SERVER   Save and Send Execution Plan Via Email

You can open the sqlplan file in the notepad and you will see xml details for the plan.

exec7 SQL SERVER   Save and Send Execution Plan Via Email

Reference : Pinal Dave (http://blog.SQLAuthority.com)

Interview Question of the Week #044 – What is the difference of performance between SELECT and SET?

Question: What is the difference of performance between SELECT and SET?


SELECT : Designed to return data.
SET : Designed to assign values to local variables.

While testing the performance of the following two scripts in query analyzer, interesting results are discovered.

SET @foo1 = 1;
SET @foo2 = 2;
SET @foo3 = 3;
@foo1 = 1,
@foo2 = 2,
@foo3 = 3;

While comparing their performance in loop SELECT statement gives better performance then SET. In other words, SET is slower than SELECT. The reason is that each SET statement runs individually and updates on values per execution, whereas the entire SELECT statement runs once and update all three values in one execution.

SET is the ANSI standard for variable assignment, SELECT is not. SET can only assign one variable at a time, SELECT can make multiple assignments at once – that gives SELECT slight speed advantage over SET. If assigning from a query, SET can only assign a scalar value. If the query returns multiple values/rows then SET will raise an error. SELECT will assign one of the values to the variable and hide the fact that multiple values were returned. When assigning from a query if there is no value returned then SET will assign NULL, where SELECT will not make the assignment at all keeping the variable unchanged.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – How to Suppress SQL Server messages in Application Event Log

Error messages are a great source of help when it comes to troubleshooting. What can I say, this is maybe be the most repeated phrase from me in this blog about error messages. The messages have grown over ages and got better with the SQL Server dev team putting in extra effort in every release. Having said that, I thought of adding something interesting in this blog.

Logging of errors in ERRORLOG is helpful in many situations. It has helped me many time to fix issues. Recently I came across an email where there was a strange behavior reported. Here in the email from my friend.

Hi Pinal,
We are using 3rd party software which uses SQL Server as backend. We also have monitoring software which keeps track of messages in Event log and sends alert to Wintel team.
Recently there was a brute force attach for sa password on that server so there were many login failure attempts like below:

2015-11-05 20:14:47.040 Logon        Error: 18456, Severity: 14, State: 8.

2015-11-05 20:14:47.040 Logon        Login failed for user ‘sa’. Reason: Password did not match that for the login provided. [CLIENT:]

There messages were logged many time and IP address listed there is some machine which we don’t know. We were able to stop the connection by firewall.

Here is the problem: Monitoring software didn’t report anything because strangely these messages were NOT logged in application event log at all.

Do you know how that can happen?
Thanks in advance.

Whenever I get such questions, I always asked for ERRORLOG.

SQL SERVER – Where is ERRORLOG? Various Ways to Find its Location

I looked into ERRORLOG file and found something interesting as below.

Registry startup parameters:

-d D:\MSSQL12.SQL2014\MSSQL\DATA\master.mdf
-l D:\MSSQL12.SQL2014\MSSQL\DATA\mastlog.ldf

Command Line Startup Parameters:

-s "SQL2014"

We can see a non-default startup parameter called “n”. I searched MSDN documentation and found its usage. “Does not use the Windows application log to record SQL Server events”

So I replied to my friend and later it was identified that 3rd party tool has done that change for that instance.

Mystery solved and I learned something new.  Have you ever used any such non-default startup parameter in production server?

Reference: Pinal Dave (http://blog.sqlauthority.com)

SQL SERVER – How to Change SQL Server Product Key or License Key?

I try to refrain from talking about licensing related topics because they seem to be complicated and have tons of permutations and combinations. Having said that, in the recent past, I was baffled to see this query land to my Inbox which was interesting and needed some attention from me. I could have easily put it under the rug and forget but this kept haunting me for a long time. So I decided to check with a couple of senior DBA’s who manage 1000’s of servers and how they manage doing something like this. So I called up, learnt a few tips around licensing and this is what I have assimilated from the discussion. Though this discussion and facts stand true as on date of publication of this blog, some of the nuances might change maybe in the future. That might make some of the licensing terms void. But the process to change license key will always be something useful to you in my opinion.

SQL Server can be purchased via various channels like MSDN, Volume License, Full Packaged Product (FPP) or OEM. Sometimes it may happen that:

  • You have installed SQL Server from MSDN media and later you purchased media via Volume License channel and you want to update the license key used by SQL Server.
  • You have an MSSQL install that was purchased by one department, but now a new department wants to take over the install and want to use their own license.

The steps to update product key is simple. Actually, these are the same steps which are required to upgrade the edition of SQL Server. While changing product key, there is no “real” edition upgrade.

  1. Run setup.exe from the media.


If you have SQL already installed, then you can also launch “Installation Center” by going to Start->Programs ->Microsoft SQL Server 2008[R2]->Configuration Tools-> SQL Server Installation Center[(64-bit)].

  1. You would get below screen titled “SQL Server Installation Center”
  2. Go to “Maintenance” and click on “Edition Upgrade” as shown below
    PID Key 01 SQL SERVER   How to Change SQL Server Product Key or License Key?
  3. Go through the wizard and make sure that new key is entered in below screen.

PID Key 02 SQL SERVER   How to Change SQL Server Product Key or License Key?

If you have a requirement to do this on multiple server and going through the setup wizard is not an option, then you can use below command line also.

For Default Instance:


For Named Instance:

Setup.exe /q /ACTION=EditionUpgrade /INSTANCENAME=InstanceName /PID=<PID key for new edition>” /IACCEPTSQLSERVERLICENSETERMS

Have you ever changed product key? What have you done in the past? What techniques have you used to perform this task? Do let me know about your experiences too.

Reference: Pinal Dave (http://blog.sqlauthority.com)

MySQL – Different Methods to Know MySQL Version

In SQL Server, to know the current version of the server, you can use system variable @@VERSION

How many of you know that the same can be used in mysql to know the version?

Also there are many ways to know the version of MySQL

Method 1:

Select @@version as version

It will display the current version of the MySQL Server

There is another function named version()

Method 2:

Select version() as version

The above produces the same result as @@version

You can also use another method to know this

Method 3:

Show variables like '%version%'

The above returns a resultset with two columns variable_name and value. You can find the version where variable_name says version.

Reference: Pinal Dave (http://blog.sqlauthority.com)