Quantcast
Channel: SQL Error Messages Archives - SQL Authority with Pinal Dave
Viewing all 425 articles
Browse latest View live

SQL SERVER 2016 – WARNING: Setup Limited to Reporting Services for SharePoint

$
0
0

I have a habit of generally reading the “What’s New” section whenever a new version is around in the block. This is a great way to actually check, learn everything that is getting released in a nutshell. These often don’t just mean we can master them in that single page, but it gives us enough information to start our journey for exploration. Let us learn about Setup Limited to Reporting Services for SharePoint warning.

Also, it is important that you keep learning and testing various scenarios because I get pushed into customer environments that challenge me. During my lab testing, I was trying to install SQL Server 2016. As soon as I clicked on the setup, I was welcomed with below warning. This was fundamentally for one of my client assignments wherein I was helping them as part of migration to the latest version of SQL Server.

Setup limited to Reporting Services for SharePoint”. As the message says further – “This server is running Windows Server 2008 R2

SQL SERVER 2016 - WARNING: Setup Limited to Reporting Services for SharePoint setup16-01

I went back and looked into the documentation and found issue listed here.

Issue:

There is a table for operating system support which doesn’t list Windows Server 2008 R2. The minimum operating system is Windows Server 2012. This was not new because these compatibility lists are always published by Microsoft with every single release. Understanding the supportability matrix and making sure these are adhered to is critical in production environments. If we override the warning, be aware that the support might not apply in case we get into issues later.

I am curious to know if you have installed such environments at your work? What are those scenarios when you did this as a DBA? Did you appraise your decision makers of such warnings? Will be great to understand your experience – do let us know via comments please.

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

First appeared on SQL SERVER 2016 – WARNING: Setup Limited to Reporting Services for SharePoint


SQL SERVER – Install Error – Could not Find the Database Engine Startup Handle

$
0
0

Note: There are multiple reason of above error and this blog shows just one of them. I am sure that this blog would give you guideline about what do to in case you see this error about install error.

Some errors are generic and there is no single path / root cause for the same. It is important to know at least the basic path one needs to take while troubleshooting. One of the reasons of loving my consultancy job is that I learn something new every day. I found myself again in learning state when I was trying to help one of my clients to assist in installation of SQL Server in a new environment. While installing SQL, it was stuck at below error message.

SQL SERVER - Install Error - Could not Find the Database Engine Startup Handle handle-01-800x602

Whenever I see any error in the setup, I start looking at setup logs. One thing which I have learned in the past is that whenever we see “Could not find the Database Engine startup handle” it is mostly due to SQL service startup failure during installation. We had no other option than hitting OK. At the end, I looked into the Summary.txt file as pointed at the last screen. Here is what I found:

Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
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: 0x851A0019
Error description: Could not find the Database Engine startup handle.

In the setup logs folder, we should have a file with name “SQLServer_ERRORLOG_<DATETIME>” which is saved copy of ERRORLOG when SQL was unable to start. Here is what we found in that file.

Cannot use file ‘M:\MSSQL11.MSSQLSERVER\MSSQL\DATA\master.mdf’ because it was originally formatted with sector size 4096 and is now on a volume with sector size 2097152. Move the file to a volume with a sector size that is the same as or smaller than the original sector size.
Cannot use file ‘L:\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf’ because it was originally formatted with sector size 4096 and is now on a volume with sector size 2097152. Move the file to a volume with a sector size that is the same as or smaller than the original sector size.

Since this is about sector size, I referred KB

https://support.microsoft.com/en-us/kb/926930 (Hard disk drive sector-size support boundaries in SQL Server)

This doesn’t list that big number 2097152. Since it was an issue due to hardware, I asked them to contact Vendor and they provided a fix.

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

First appeared on SQL SERVER – Install Error – Could not Find the Database Engine Startup Handle

SQL SERVER Installation – FeatureUpgradeMatrixCheck (SQL Server 2016 Feature Upgrade) setup rule failed

$
0
0

One of the best ways to learn problems faced by individuals and organizations is to look at the forums for these issues. Often I have visited MSDN forums and see if there are some hot or interesting issues. Sometimes it is interesting to see some setup failures and investigate for the root cause. They might look trivial, but the best part is going the path of troubleshooting can be refreshing and gives you immense satisfaction to how things work inside SQL Server or Windows. This blog is inspired by one such error that encountered and I found it interesting enough to share it on this blog for the benefit of a larger audience. Let us learn about SQL Server Installation Error.

Recently there was a post where failure of rule FeatureUpgradeMatrixCheck was reported.

Rule “SQL Server 2016 Feature Upgrade” failed.

The specified edition upgrade from source Enterprise edition to target Evaluation edition is not supported. For information about supported upgrade paths, see the SQL Server 2016 version and edition upgrade in Books Online.

SQL SERVER Installation - FeatureUpgradeMatrixCheck (SQL Server 2016 Feature Upgrade) setup rule failed RuleFailed-800x597

I looked into Detail.txt and I have highlighted the line which explains the crux of the problem.

(17) 2016-07-11 03:05:42 Slp: Initializing rule : SQL Server 2016 Feature Upgrade
(17) 2016-07-11 03:05:42 Slp: Rule is will be executed : True
(17) 2016-07-11 03:05:42 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.SkuUpgradeRule
(17) 2016-07-11 03:05:42 Slp: — SkuUpgradeRule : Rule ‘FeatureUpgradeMatrixCheck’ looking for previous version upgrade data for feature package ‘sql_as_Cpu64’.
(17) 2016-07-11 03:05:42 Slp: — SkuUpgradeRule : Rule ‘FeatureUpgradeMatrixCheck’ feature package ‘sql_as_Cpu64’ found no upgrade features.
(17) 2016-07-11 03:05:42 Slp: — SkuUpgradeRule : Rule ‘FeatureUpgradeMatrixCheck’ looking for previous version upgrade data for feature package ‘sql_engine_core_inst_Cpu64’.
(17) 2016-07-11 03:05:42 Slp: — SkuUpgradeRule : Found feature package ‘sql_engine_core_inst_SQL14_Cpu64’ with SkuValue=ENTERPRISE (Enterprise) ProductVersion=12.0.2000.8
(17) 2016-07-11 03:05:42 Slp: — SkuUpgradeRule : Rule ‘FeatureUpgradeMatrixCheck’ found sourceVersion 12.0.0 and edition ENTERPRISE for feature package ‘sql_engine_core_inst_Cpu64’.
(17) 2016-07-11 03:05:42 Slp: — SkuPublicConfigObject : ValidateSkuMatrix checking sku matrix for sourceVersion=12.0.0 sourceEdition=ENTERPRISE (Enterprise) sourceArchitecture=X64 targetEdition=EVAL (Evaluation) targetArchitecture=X64
(17) 2016-07-11 03:05:42 Slp: — SkuPublicConfigObject : ValidateSkuMatrix source and target architecture match.
(17) 2016-07-11 03:05:42 Slp: — SkuPublicConfigObject : ValidateSkuMatrix did not find a match in sku matrix .
(17) 2016-07-11 03:05:42 Slp: — SkuUpgradeRule : Rule ‘FeatureUpgradeMatrixCheck’ feature package ‘sql_engine_core_inst_Cpu64’ is blocking upgrade.
(17) 2016-07-11 03:05:42 Slp: — SkuUpgradeRule : Rule ‘FeatureUpgradeMatrixCheck’ detection result: IsValidFeatureUpgrade=False
(17) 2016-07-11 03:05:42 Slp: Evaluating rule : FeatureUpgradeMatrixCheck
(17) 2016-07-11 03:05:42 Slp: Rule running on machine: LAB-SQL-SERVER
(17) 2016-07-11 03:05:42 Slp: Rule evaluation done : Failed
(17) 2016-07-11 03:05:42 Slp: Rule evaluation message: The specified edition upgrade from source Enterprise edition to target Evaluation edition is not supported. For information about supported upgrade paths, see the SQL Server 2016 version and edition upgrade in Books Online.

Whenever there are issues with upgrade, I always look for topic “Supported Version and Edition Upgrades”

If we look at source edition, its ENTERPRISE and target is EVAL. Here is the document for SQL Server 2016.

As per books online “SQL Server 2014 Enterprise” can only be upgraded to “SQL Server 2016 Enterprise” and “SQL Server 2016 Business Intelligence” and hence the error.

Have you ever faced similar rule failure? How did you fix them?

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

First appeared on SQL SERVER Installation – FeatureUpgradeMatrixCheck (SQL Server 2016 Feature Upgrade) setup rule failed

SQL SERVER – What is Deadlock Scheduler? How to Reproduce it?

$
0
0

If you have come on this page by internet search, then you must have seen below error in the ERRORLOG which is about deadlock scheduler.

2016-07-25 08:50:29.50 Server * *******************************************************************************
2016-07-25 08:50:29.50 Server *
2016-07-25 08:50:29.50 Server * BEGIN STACK DUMP:
2016-07-25 08:50:29.50 Server * 07/25/16 08:50:29 spid 1448
2016-07-25 08:50:29.50 Server *
2016-07-25 08:50:29.50 Server * Deadlocked Schedulers
2016-07-25 08:50:29.50 Server *
2016-07-25 08:50:29.50 Server * *******************************************************************************

SQL SERVER - What is Deadlock Scheduler? How to Reproduce it? dls-02 Most of the time this error causes hang of SQL Server and restart is the only solution. First, let’s make sure that you are not thinking above message as same what you see in SQL RDBMS. This is NOT same as two processes blocking each other and waiting for each other to release locks.  The Deadlocked of Schedulers applies to SQL OS Schedulers and gives indication that things are not moving on that scheduler.

Here is how you can reproduce it. Basically, we would cause heave blocking in SQL Server after reducing the number of worker threads.  Bold, Red means Danger!

PLEASE DO NOT ATTEMPT THIS ON PRODUCTION SERVER.

Step 1: Reduce Max Worker threads

You can run below in SSMS

sp_configure 'max worker threads', 128
go
reconfigure with override
go
--Confirm the new value i.e. 128
sp_configure 'max worker threads'
go

Step 2: Download and Install RML utilities

Here is the link. We are going to use ostress tool to run the same query via multiple connections.

Step 3: Create Database and Objects

Run below in SSMS.

create database DeadlockSchedulersDemo
go
use DeadlockSchedulersDemo
go
Create Table BlockingTable( i int)
Go

Step 4: Generate error

We need to run below in SSMS. This would leave an open transaction and no one can read data from table in default isolation level (read committed)

begin tran
insert into BlockingTable values (1)

Open command prompt and go to the location where you have installed RML (step 2) and run below. Replace the server name in S parameter

ostress -S. -dDeadlockSchedulersDemo -Q"Select * from BlockingTable" -n200

SQL SERVER - What is Deadlock Scheduler? How to Reproduce it? dls-01

At this point you would NOT be able to connect to SQL Server via SSMS. You need to wait for some time and soon you would start seeing below in ERRORLOG

2016-07-25 08:50:32.91 Server New queries assigned to process on Node 0 have not been picked up by a worker thread in the last 300 seconds. Blocking or long-running queries can contribute to this condition, and may degrade client response time. Use the “max worker threads” configuration option to increase number of allowable threads, or optimize current running queries. SQL Process Utilization: 0%. System Idle: 98%.

SQL SERVER - What is Deadlock Scheduler? How to Reproduce it? dls-03

As we can see above, we have exhausted worker threads (remember that we reduced it to 128). The scheduler on Node 0 is not able to make any progress and printing the message in ERRORLOG every 5 minutes (300 seconds increment)

Step 5: Cleanup

You can hit Ctrl + C on ostess command prompt and also run commit transaction in the window where we had performed insert statement under a transaction.

Now, reset the value to zero for worker threads.

sp_configure 'max worker threads', 0
go
reconfigure with override
go
--Confirm the new value i.e. 0
sp_configure 'max worker threads'
go

Did this demo help you in understanding the error about deadlock scheduler? It might take less time to reproduce it.

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

First appeared on SQL SERVER – What is Deadlock Scheduler? How to Reproduce it?

SQL SERVER – Event 17058 – initerrlog: Could not Open Error Log File

$
0
0

If you have ever interacted with me or taken my services, you would notice that I always ask for ERRORLOG in almost all of my contact with my client. Once of my friend contacted me and when I asked for ERRORLOG, he informed that there is no ERRORLOG file and SQL is not getting started.  I suggested him that we should analyze event log for further details, after interestingly, we found the following details in the event 17058 about initerrlog: Could not Open Error Log File.

Log Name: Application
Source: MSSQLSERVER
Event ID: 17058
Task Category: Server
Level: Error
Description:
initerrlog: Could not open error log file ”. Operating system error = 3(The system cannot find the path specified.).

We finally found that the error occurs due to the insufficient privilege of SQL Server Service Account in the Log directory: E:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Log

Here is the fix of the issue.

  1. Start SQL Server Configuration manager.
  2. Click to select ‘SQL Server Services’ from the left menu options.
  3. On the right panel, right click on ‘SQL Server (MSSQLSERVER)’ and click ‘Properties’. You may want to choose correct service.
  4. Click ‘Startup Parameters’ tab.
    SQL SERVER - Event 17058 - initerrlog: Could not Open Error Log File initerrlog-01
  1. Note the location after -e parameter.
  2. Browse the Log location ” E:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER \MSSQL\Log”.
  3. Right click on the folder “Log” and click Properties and then to visit to “Security” tab. Now, check SQL Server service account permission on this folder and give proper access to this folder.
  4. Now, Restart the SQL Server service. If you face the same error again, try to change highly privileged service account like “Local System”.

After giving permission, we were able to start the SQL Service. Have you faced a similar error?

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

First appeared on SQL SERVER – Event 17058 – initerrlog: Could not Open Error Log File

SQL SERVER – Creating a Copy of Database in Azure SQL DB

$
0
0

Recently I was about to undertake an interesting assignment for one of my clients who pinged me for Performance Tuning exercise. Since this is something I have been doing full time in the past couple of months, I got into the call immediately. Lesser did I know what I was about to get into actually. Since the problem was about SQL Server query performance, I thought it would be the usual routine. Let us learn about how to create a copy of the database in Azure SQL DB.

On getting over the initial call on Skype, I got to know it was an Azure SQL Database – which in this case didn’t matter because they had a badly written query. Generally, the optimizations that happen are common irrespective of where the database is. Coming back to the context of this blog – the customer was troubleshooting this on production database and requested that we can work off a copy of the database.

The DBA was asking me about how they can take a backup and restore process. Since this was Azure SQL DB, they were not sure of the process. I asked if they were aware of the Export-Import wizard? As you can see below, the database on an Azure SQL DB would look a little different.

SQL SERVER - Creating a Copy of Database in Azure SQL DB copy-database-azure-db-01

Best part of working with Azure SQL databases is the fact that we can use TSQL command to actually create a copy of any database. A typical query would look like:

CREATE DATABASE [new_sqlauth] AS COPY OF [sqlauth-demo].[sqlauth-DemoDB]
GO

In this case I have taken a demo database and created an exact copy.

SQL SERVER - Creating a Copy of Database in Azure SQL DB copy-database-azure-db-02

This was so seamless that I had that database for playing / testing for the duration of troubleshooting. Once I was done with the exercise in about a couple of hours, the team just dropped the database using a standard syntax.

-- Clean up script
DROP DATABASE [new_sqlauth]
GO

For curiosity sake, I was seeing the DBA wants to try the same thing on an on premise SQL Server. This will yield in a syntax error as shown below:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ‘copy’.

Earlier, I used to say the on premise SQL Server had many cool features which were evidently missing on Azure SQL Databases. But I might need to revisit that statement because the more I start exploring and work on Azure, there are some interesting capabilities that surprise me every single day.

Do let me know if you are working on Azure SQL DB. What have been your experiences? Tell me via your comments below.

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

First appeared on SQL SERVER – Creating a Copy of Database in Azure SQL DB

SQL SERVER – Installation Fails With Error – A Constraint Violation Occurred

$
0
0

In my recent past, I have helped around 10 customers who have had similar problems while installing SQL Server Cluster on windows. So I thought it would be a nice idea to pen it down as a blog post so that it can help others in future. In this blog post we will discuss about Installation Fails With Error – A Constraint Violation Occurred.

The issue which we saw was that SQL Server cluster setup would create a network name resource in failover cluster manager and it would fail. Here is the message which we would see in the setup

The cluster resource ‘SQL Server (SQLSQL)’ could not be brought online due to an error bringing the dependency resource ‘SQL Network Name (SAPSQL)’ online. Refer to the Cluster Events in the Failover Cluster Manager for more information.
Click ‘Retry’ to retry the failed action, or click ‘Cancel’ to cancel this action and continue setup.

When we look at event log, we saw below message (event ID 1194)

Log Name: System
Source: Microsoft-Windows-FailoverClustering
Date: 20/06/2016 19:55:45
Event ID: 1194
Task Category: Network Name Resource
Level: Error
Keywords:
User: SYSTEM
Computer: NODENAME1.internal.sqlauthority.com
Description:
Cluster network name resource ‘SQL Network Name (SAPSQL)’ failed to create its associated computer object in domain ‘internal.sqlauthority.com’ during: Resource online.
The text for the associated error code is: A constraint violation occurred.
Please work with your domain administrator to ensure that:
– The cluster identity ‘WINCLUSTER$’ has Create Computer Objects permissions. By default all computer objects are created in the same container as the cluster identity ‘WINCLUSTER$’.
– The quota for computer objects has not been reached.
– If there is an existing computer object, verify the Cluster Identity ‘WINCLUSTER$’ has ‘Full Control’ permission to that computer object using the Active Directory Users and Computers tool.

Another client got “Access is denied” messages instead of “A constraint violation occurred” in above event ID. My clients have informed that they have logged in as domain admin so Access denied is impossible. Error from another client is below.

SQL SERVER - Installation Fails With Error - A Constraint Violation Occurred setup-err-01

I explained all of them that when network name is created in a cluster, it would contact active directory (AD) domain controller (DC) via Windows Cluster Network name computer account also called as CNO (Cluster Network Object). So, whatever error, we are seeing are possible because the domain admin account (windows logged in user account) is not used to create a computer object for SQL in AD.

To solve this problem, we logged into the domain controller machine and created the Computer Account: SAPSQL (called as VCO – Virtual Computer Object). Gave the cluster name WINCLUSTER$ full control on the computer name. If we carefully read error message, we have the solution already listed there. Then clicked on the retry option in the setup. The setup continued and completed successfully.

Solution/Workaround:

Here are the detailed steps (generally done on a domain controller by domain admin):

  1. Start > Run > dsa.msc. This will bring up the Active Directory Users and Computers UI.
  2. Under the View menu, choose Advanced Features.
  3. If the SQL Virtual Server name is already created, then search for it else go to the appropriate OU and create the new computer object [VCO] under it.
  4. Right click on the new object created and click Properties.
  5. On the Security tab, click Add. Click Object Types and make sure that Computers is selected, then click Ok.
  6. Type the name of the CNO and click Ok. Select the CNO and under Permissions click Allow for Full Control permissions.
  7. Disable the VCO by right clicking.

This is also known as pre-staging of the VCO.

Hope this would help someone to save time and resolve issue without waiting for someone else assistance. Do let me know if you ever encountered the same.

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

First appeared on SQL SERVER – Installation Fails With Error – A Constraint Violation Occurred

SQL SERVER – A Timeout (30000 milliseconds) was Reached While Waiting for a Transaction Response from the MSSQLSERVER

$
0
0

SQL SERVER - A Timeout (30000 milliseconds) was Reached While Waiting for a Transaction Response from the MSSQLSERVER anothererror Recently I was contacted by a client who reported very strange error in the SQL Server machine. These consulting engagements sometimes get the best out of you when it comes to troubleshooting. They reported that they see timeout error. My question was whether it connection timeout or query timeout which I explained in this blog post?

They said that they are seeing below error in the System Event log and during that time they were not able to connect to SQL Server.

Event ID: 7011
Message: A timeout (30000 milliseconds) was reached while waiting for a transaction response from the MSSQLSERVER service.

Once it happens, they were not able to stop SQL Server service. I asked about how do they reproduce the error or hang situation and strangely they said that it happens when they expand an Oracle Linked server in SQL Server Management Studio!!!

I told them to reproduce the error. As soon as they expand “catalog” under linked server to oracle, it was stuck in “expanding”. Luckily, I was with them and as soon as “hang” was reproduced, I connected via DAC connection. I was able to see PREEMPTIVE_OS_GETPROCADDRESS wait for the SSMS query. As per my internet search, it is called when loading DLL. In this case, the wait for increasing continuously. So I asked them to kill the SQL process from task manager.

As a next step, I wanted to know which is the DLL causing issue, so I captured Process Monitor while reproducing the issue. Finally, we were able to nail down that SQLServr.exe is trying to find “OraClient11.Dll” but not able to locate it.

It didn’t take much time to conclude that the hang was caused due to incorrect value in PATH variable for Oracle DLLs used by linked server. This is also explained here.

Solution

We found that PATH variable was not having C:\oracle11\product\11.2.0\client_1\BIN which was the folder contains OraClient11.Dll. As soon as we added above location to PATH variable, issue was resolved.

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

First appeared on SQL SERVER – A Timeout (30000 milliseconds) was Reached While Waiting for a Transaction Response from the MSSQLSERVER


SQL SERVER – False Error – Cannot bulk load because the file could not be opened. Operating system error code 5 (Access is denied.)

$
0
0

Yes, it’s possible that SQL Server can raise false and misleading error. I was trying to do some pretty straight forward stuff – import data from text file to SQL table using the BULK INSERT command of T-SQL. Let us learn about false errors from Operating system error code 5 (Access is denied.)

Here is the script to create some sample data.

Create Database ErrorDB
GO
USE ErrorDB
GO
CREATE TABLE [dbo].[SQLAuthotity](
	[Id] [int] NOT NULL,
	[Name] [char](200) NULL,
	[ModDate] [datetime] NULL
)
GO
INSERT INTO SQLAuthotity VALUES (1, 'MR. DAVE', GETDATE())
GO
INSERT INTO SQLAuthotity VALUES (2, 'MISS. DAVE', GETDATE())
GO
INSERT INTO SQLAuthotity VALUES (3, 'MRS. DAVE', GETDATE())
GO

Now, we can export this data to a text file using bcp command. Then, we would import the data back from the table. To export the data, we will use below bcp.exe command

bcp.exe ErrorDB..SQLAuthotity out “c:\Temp.txt” -c -T -S.\SQL2014

Once it was completed, I wanted to insert the data back into the table. So I ran this command

USE ErrorDB
GO
BULK INSERT SQLAuthotity
FROM 'C:\Temp'
WITH
(
  KEEPNULLS,
  FIRSTROW=2,
  FIELDTERMINATOR ='\t',
  ROWTERMINATOR ='\n'
)

SQL SERVER - False Error - Cannot bulk load because the file could not be opened. Operating system error code 5 (Access is denied.) bcp-err-01-800x257

To my surprise, it failed with below error

Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file “C:\Temp” could not be opened. Operating system error code 5(Access is denied.).

I have tried all the combination of permission (service account, local admin, everyone etc.) but this error was not getting away.

I was unable to fix it so I gave up for the day and decided to start fresh. I ran the command and it was working. Do you know how?

Solution / Workaround

In this special case, if you look at the command which was not working I have given “C:\Temp” instead of “C:\Temp.txt”. Since I had a folder by name Temp in C drive, it was failing with an error, which was not true error. Yes, access denied error was a fake error in this case. It should have told me that the name is not a file, but it’s a directory.

Have you seen similar incorrect or unhelpful error in SQL Server?

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

First appeared on SQL SERVER – False Error – Cannot bulk load because the file could not be opened. Operating system error code 5 (Access is denied.)

SQL SERVER – Backup to URL Fails in Azure Resource Manager (ARM) Deployment Model with Error – (400) Bad Request

$
0
0

During my previous consulting engagement, I learned something new with SQL Server feature called back up to the URL. Since it was not so clearly documented, I am sharing this with you. In this blog post, let us learn about Azure Resource Manager. If you have not heard about this feature, you can think of it as variation of the SQL backup feature. In this type of backup, the destination would be an Azure storage rather than disk or tape. You can read more about this feature on my previous blog SQL SERVER – Backup to Azure Blob using SQL Server 2014 Management Studio.

My client was trying to take a backup on Azure, on a storage deployed under the ARM deployment model. You can read more about classic and ARM deployment models on below link.

Azure Resource Manager vs. classic deployment: Understand deployment models and the state of your resources

Here is how they are seen on https://ms.portal.azure.com  as of today.

SQL SERVER - Backup to URL Fails in Azure Resource Manager (ARM) Deployment Model with Error - (400) Bad Request b2url-01

Here is the error they were getting

Msg 3271, Level 16, State 1, Line 9
A nonrecoverable I/O error occurred on file “” Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: (400) Bad Request..
Msg 3013, Level 16, State 1, Line 9
BACKUP DATABASE is terminating abnormally.

I was able to reproduce the same error for ARM storage accounts (blob storage)

Solution / Workaround

If you are trying to take a backup to Azure blob storage in the ARM deployment model, then make sure the “kind” of storage account should be selected as “General” while creating storage account. If we choose “Blob Storage” then it would fail.

The below image shows the option to choose while creating it.

SQL SERVER - Backup to URL Fails in Azure Resource Manager (ARM) Deployment Model with Error - (400) Bad Request b2url-02

SQL SERVER - Backup to URL Fails in Azure Resource Manager (ARM) Deployment Model with Error - (400) Bad Request b2url-03

If you already have an account created, then you can check it via looking at the icon.

SQL SERVER - Backup to URL Fails in Azure Resource Manager (ARM) Deployment Model with Error - (400) Bad Request b2url-04

Have you faced this problem?

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

First appeared on SQL SERVER – Backup to URL Fails in Azure Resource Manager (ARM) Deployment Model with Error – (400) Bad Request

SQL SERVER – SSMS Error During Restore: No Backupset Selected to be Restored

$
0
0

There are various ways of learning in my current role. Along with client engagements, reading others blog, I also learn from comment/interaction of my own blog. One of my blog readers sent below email about Backupset.

Hi Pinal,
I am a Java developer and have a very less knowledge of SQL Server. To reproduce the scenario. I’m trying to restore my customer’s SQL Server 2008 database (foo.bak) on to our SQL Server 2012. I right clicked on the database in the Management studio 2012, restore database using source – device option, select foo.bak file for the restore. But it is not recognizing the backup file, I keep getting ‘No backupset selected to be restored‘. It doesn’t show up under the restore plan either. I am not sure what I’m missing.

Please help me!

I asked him more details and screenshot and below was given to me.

Here is the SSMS image after backup is selected.

SQL SERVER - SSMS Error During Restore: No Backupset Selected to be Restored backupset-01-800x358

If we click on the message, we see below the text of a pop-up message.

No backupset selected to be restored.

I did some research and shared possible caused by him.

POSSIBLE REASONS

1) Backup is corrupted or unreadable: To confirm this, we can run below command

RESTORE HEADERONLY FROM DISK='complete path to backup file>

If backup is corrupted, we would not be able to see the complete details in the output.

2) Restore to lower version: If a backup is taken on a higher version and restore is attempted to lower version then also we will get the same error.

He replied and told me that backup is not readable and its corrupted. They took a fresh backup from the source database and then they were able to restore.

Have you ever encountered a similar error? Please leave a comment.

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

First appeared on SQL SERVER – SSMS Error During Restore: No Backupset Selected to be Restored

SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step ‘upgrade_ucp_cmdw.sql’

$
0
0

Recently once by my client contacted via Skype to know my thoughts about a cluster failover failure issue. They were having two nodes SQL Clustered instance and it was running fine of Node1. As soon as they failover to Node2, it was not able to start and was failing with upgrade script. Let us learn about the script level upgrade for database ‘master’ failed because upgrade step ‘upgrade_ucp_cmdw.sql’.

SQL SERVER - Script level upgrade for database 'master' failed because upgrade step 'upgrade_ucp_cmdw.sql' failover-mdw-01

2016-08-16 10:07:00.52 Logon Error: 18401, Severity: 14, State: 1.
2016-08-16 10:07:00.52 Logon Login failed for user ‘NT AUTHORITY\SYSTEM’. Reason: Server is in script upgrade mode. Only administrator can connect at this time. [CLIENT: 172.19.10.94] 2016-08-16 10:07:00.55 spid9s Restoring database to multi user mode before aborting the script
2016-08-16 10:07:00.55 spid9s Setting database option MULTI_USER to ON for database sysutility_mdw.
2016-08-16 10:07:00.55 spid9s Error: 14714, Severity: 21, State: 1.
2016-08-16 10:07:00.55 spid9s Attempting to upgrade a Management Data Warehouse of newer version ‘10.50.4042.0’ with an older version ‘10.50.4000.0’. Upgrade aborted.
2016-08-16 10:07:00.55 spid9s Error: 2745, Severity: 16, State: 2.
2016-08-16 10:07:00.55 spid9s Process ID 9 has raised user error 14714, severity 21. SQL Server is terminating this process.
2016-08-16 10:07:00.55 spid9s Error: 912, Severity: 21, State: 2.
2016-08-16 10:07:00.55 spid9s Script level upgrade for database ‘master’ failed because upgrade step ‘upgrade_ucp_cmdw.sql’ encountered error, state 2, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
2016-08-16 10:07:00.55 spid9s Error: 3417, Severity: 21, State: 3.
2016-08-16 10:07:00.55 spid9s Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
2016-08-16 10:07:00.55 spid9s SQL Trace was stopped due to server shutdown. Trace ID = ‘1’. This is an informational message only; no user action is required.

I asked to share the complete ERRORLOG and here is what I saw.

Here is one old blog on the same topic.

SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step ‘sqlagent100_msdb_upgrade.sql’

Here is an interesting line of the error:

Attempting to upgrade a Management Data Warehouse of newer version ‘10.50.4042.0’ with an older version ‘10.50.4000.0’. Upgrade aborted.

Above line means upgrade is aborted because SQL is trying to upgrade from newer version to an older version. As per online documentation build 10.50.4042 came from MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 GDR: July 14, 2015 and 10.50.4000 is SQL Server 2008 R2 Service Pack 2 (SP2)

This means where was a version mismatch of SQL Server binaries on both the nodes.

Solution/Workaround

We looked into version of SQLServr.exe on both nodes and found that the problem node was having version 10.50.4000 whereas working node was having version of 10.50.4042.

As soon as we applied the same patch on both the nodes, failover was working like a charm!

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

First appeared on SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step ‘upgrade_ucp_cmdw.sql’

SQL SERVER – Fix Error – Cannot use the backup file because it was originally formatted with sector size 4096 and is now on a device with sector size 512

$
0
0

Here is a recent email which I received from Madhu. He is a beginner in the SQL Server and when he tried to take a backup from SSMS (SQL Server Management Studio), he got error related to backup file. As soon as he sent me an email I knew what was the exact problem, he was facing and I was able to help him quickly. Let us first recreate the same error and later on see how to fix the same.

When he tried to take backup of his database, he received following error:

System.Data.SqlClient.SqlError: Cannot use the backup file because it was originally formatted with sector size 4096 and is now on a device with sector size 512. (Microsoft.SqlServer.Smo)

You can see in the following image the error window in SSMS.

SQL SERVER - Fix Error - Cannot use the backup file because it was originally formatted with sector size 4096 and is now on a device with sector size 512 sectorerror1

Well, the solution for the same is very easy.

Solution / Workaround:

The reason for the error is that the backup file which was created was created with different sector size and it is not possible to use it now. In the SSMS we can see there is already one file in the Destination.

First remove the existing file in SSMS.

SQL SERVER - Fix Error - Cannot use the backup file because it was originally formatted with sector size 4096 and is now on a device with sector size 512 sectorerror2

Next, add a new file to the backup location.

SQL SERVER - Fix Error - Cannot use the backup file because it was originally formatted with sector size 4096 and is now on a device with sector size 512 sectorerror3

That’s it! We are done!

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

First appeared on SQL SERVER – Fix Error – Cannot use the backup file because it was originally formatted with sector size 4096 and is now on a device with sector size 512

SQL SERVER – How to Fix Error 8134 Divide by Zero Error Encountered

$
0
0

Here is one of the most popular questions: How to overcome (Error 8134) Divide by Zero Error Encountered in SQL Server?

SQL SERVER - How to Fix Error 8134 Divide by Zero Error Encountered devidebyzero-800x600

Before we see the answer of this question, let us see how to recreate this error.

Run following script in SQL Server Management Studio window.

DECLARE @Var1 FLOAT;
DECLARE @Var2 FLOAT;
SET @Var1 = 1;
SET @Var2 = 0;
SELECT @Var1/@Var2 MyValue;

When you execute above script you will see that it will throw error 8134.

Msg 8134, Level 16, State 1, Line 6
Divide by zero error encountered.

Here is the screenshot of the error.

SQL SERVER - How to Fix Error 8134 Divide by Zero Error Encountered error8134-0

Now there are multiple ways to avoid this error to happen. We will see two of the most popular methods to overcome this error.

Method 1: Use NullIf Function

Here is the SQL script with NullIf Function

DECLARE @Var1 FLOAT;
DECLARE @Var2 FLOAT;
SET @Var1 = 1;
SET @Var2 = 0;
SELECT @Var1/NULLIF(@Var2,0) MyValue;

When you use the NULLIF function, it converts the zero value to Null and leading to the entire result set to be NULL instead of an error.

SQL SERVER - How to Fix Error 8134 Divide by Zero Error Encountered error8134-1

Method 2: Use Case Statement

Here is the SQL script with CASE Statement

DECLARE @Var1 FLOAT;
DECLARE @Var2 FLOAT;
SET @Var1 = 1;
SET @Var2 = 0;
SELECT CASE WHEN @Var2 = 0 THEN NULL
ELSE @Var1/@Var2
END MyValue;

When you use CASE statement, it converts the zero value to Null and leading to the entire result set to be NULL instead of an error.

SQL SERVER - How to Fix Error 8134 Divide by Zero Error Encountered error8134-2

Let me know if you have any other alternate solution. I will be happy to publish in the blog with due credit.

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

First appeared on SQL SERVER – How to Fix Error 8134 Divide by Zero Error Encountered

SQL SERVER – GetRegKeyAccessMask : Could Not Get Registry Access Mask For Registry Key – SQL Server Cluster

$
0
0

I have been getting many requests from my HIRE-ME page and a few of them are getting change to my blog. This is the outcome of one of my clients who was having a strange issue. They were having 2 nodes SQL Server Cluster (NODE1 and NODE2) and SQL Server resource was not able to come online on NODE21 but it was working fine when they failover to NODE2.

SQL SERVER - GetRegKeyAccessMask : Could Not Get Registry Access Mask For Registry Key - SQL Server Cluster fci-no-online-01-800x824

I asked them to look at ERRORLOG when they failover to NODE2 and it doesn’t come online. SQL SERVER – Where is ERRORLOG? Various Ways to Find ERRORLOG Location

I was surprised when they told me that they are not seeing the file being generated when they attempt to bring SQL to NODE2. I thought it could be a permission issue, but there was no such permission error in Application and System Event Log. Finally, I asked them to generate Cluster Log SQL SERVER – Steps to Generate Windows Cluster Log?

Here is the relevant information I found in Cluster log

Add-ClusterCheckpoint -ResourceName "SQL Server (SQL_INST1)" -RegistryCheckpoint "Software\Microsoft\Microsoft SQL Server\MSSQL12.SQL_INST1\Replication"
Add-ClusterCheckpoint -ResourceName "SQL Server (SQL_INST1)" -RegistryCheckpoint "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.SQL_INST1\MSSQLServer"
Add-ClusterCheckpoint -ResourceName "SQL Server (SQL_INST1)" -RegistryCheckpoint "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.SQL_INST1\Cluster"
Add-ClusterCheckpoint -ResourceName "SQL Server (SQL_INST1)" -RegistryCheckpoint "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.SQL_INST1\SQLServerAgent"
Add-ClusterCheckpoint -ResourceName "SQL Server (SQL_INST1)" -RegistryCheckpoint "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.SQL_INST1\Providers"
Add-ClusterCheckpoint -ResourceName "SQL Server (SQL_INST1)" -RegistryCheckpoint "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.SQL_INST1\CPE"
Add-ClusterCheckpoint -ResourceName "SQL Server (SQL_INST1)" -RegistryCheckpoint "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.SQL_INST1\SQLServerSCP"

Error 2 = The system cannot find the file specified. So now, it’s clear that we are having issues with registry missing on this node. When I compared the key, I found that they were having missing startup parameter earlier which they added manually. Now this is next key which is missing. In general, windows cluster registry checkpoint takes care of syncing the value of registry keys for SQL Server. Here is an article by Balmukund about registry checkpoint Information: Checkpoint in SQL Server Cluster Resources

I was able to re-add the checkpoint using below PowerShell command.

As soon as the checkpoint was enabled, the registry came in sync on both the nodes and issue was resolved. Have you ever come across such issues?

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

First appeared on SQL SERVER – GetRegKeyAccessMask : Could Not Get Registry Access Mask For Registry Key – SQL Server Cluster


SQL SERVER – FIX Error 18456, Severity: 14, State: 5. Login failed for user

$
0
0

Some errors are historic and have the most common root cause. Sometimes we really don’t know why they happen and I have seen clients go nuts to identify the real reason for the problem. In a recent email interaction with one customer – who was migrating from Oracle to SQL Server. He kept telling me that they were getting login errors from their Java application. And even when they used the SQL Server Management Studio it was erroring out with Error 18456 code. They sent me a snapshot like this for login failed:

SQL SERVER - FIX Error 18456, Severity: 14, State: 5. Login failed for user login-failed-18456-01

This was not self-explanatory and as usual, I searched this blog to get a few posts around this error. I sent him this and said, if these don’t solve your problem – can you please send me more details.

SQL SERVER - FIX Error 18456, Severity: 14, State: 5. Login failed for user login-failed-18456-04

In about an hour, I received a mail again stating the above were not solving his problem. He sent me a bigger screenshot as shown below:

SQL SERVER - FIX Error 18456, Severity: 14, State: 5. Login failed for user login-failed-18456-02

Though this was a good starting point, this was not good enough information for me based on what SSMS was sending as output.

I reviewed the above blogs just to realize I had forgotten to give a bigger detail. A lot of these login failures are also logged in ErrorLog. I realized and asked the Developer to check in their error log. And incidentally, they figured out the actual root cause. Since he didn’t get back to me for 3 hours – it was my turn to ask what went wrong because I was curious to understand the actual reason. I got a screen shot as shown below and it explained quite a bit.

SQL SERVER - FIX Error 18456, Severity: 14, State: 5. Login failed for user login-failed-18456-03

If you are not sure where to get the ErrorLog, check the post: SQL SERVER – Where is ERRORLOG? Various Ways to Find ERRORLOG Location.

On further investigation, it was learnt that their application was changing the password for their users in their application code, but since it was load balanced, it was getting into some mess. But I was glad how explicit and detailed information Error Logs give that helped this user.

Have you seen and used such information in your environments for such failures? What were your troubleshooting tips? Let me know via comments.

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

First appeared on SQL SERVER – FIX Error 18456, Severity: 14, State: 5. Login failed for user

MySQL – Fix Error – WordPress Database Error Duplicate Entry for key PRIMARY for Query INSERT INTO wp_options

$
0
0

As many of you know that this blog runs on WordPress and under the hood of WordPress there is a MySQL database. MySQL database is quite good and is able to hold massive traffic this blog receives every day. However, just like any database MySQL needs tuning as well as proper management of the same. In this blog post we will discuss about how I received a very weird error WordPress Database Error and how I resolved it.

MySQL - Fix Error - WordPress Database Error Duplicate Entry for key PRIMARY for Query INSERT INTO wp_options mysqlerror-800x430

Last week, suddenly I got call from a friend that our blog is loading very slow. Well, when a new blog post is published or newsletter is sent out, it is very common to see a spike in traffic and momentarily slowness in the website performance. However, in this case, the website was consistently running slow. After a while we found a couple of new problems on the site. Due to the slowness of the performance, we also found out that WordPress scheduler was not publishing new blog posts as well as was not taking routine backup of the system.

After careful diagnostic I figured out that the issue was with MySQL Database. When I checked the error log, I found the following error in the log.

[Fri Sep 09 04:58:03 2016] [error] [client] WordPress database error Duplicate entry ‘3354142’ for key ‘PRIMARY’ for query INSERT INTO wp_options (option_name, option_value,autoload) VALUES (…)

It was very clear that there was a primary key violation in the options table. However, the problem was not easy to solve as I had personally not done any transactions with this table or there was no new update or plugin changes in the recent time. My first attempt was to restore this particular table from older database backup (I take frequent backup my site and its database). Even this particular problem failed and I was not able to get rid of the error.

Finally, I searched the internet but alas, there was no real help. At that time, I decided to do various trial and error. Trust me, I spend over 4 hours and various different tricks to get rid of this error. It was very clear to me that it was logical integrity error on the database, I had to spend time with lots of tables and logic. Well, after 4 hours, I finally found a solution and it was a very simple solution. I wish I had known this earlier and would have not spent over 4 hours on various trials and errors.

Solution / Fix:

I just ran following command it my issue was resolved.

REPAIR TABLE wp_options

That’s it! It was done.

The reality was that my table was corrupted and due to the same reason I was getting error related to Duplicate Key for my database table. Once I fixed the corruption of the table, everything worked just fine. Remember, in my case it was wp_options table which was corrupted, you must replace it with your table name and script will just work fine.

Additionally, if you want to just repair all the tables in your database, you can execute following script and it will generate scripts for every single table in your MySQL database. Once you execute the script, you will repair every single table of your database.

SELECT CONCATE('repair table ', table_name, ';') 
FROM information_schema.tables 
WHERE table_schema='YourDatabaseName';

I hope you find this blog post useful. If you ever have any problem with the WordPress MySQL database, do reach out to me, I will be happy to help you to resolve any error related to the same.

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

First appeared on MySQL – Fix Error – WordPress Database Error Duplicate Entry for key PRIMARY for Query INSERT INTO wp_options

SQL SERVER – Columnstore Index Cannot be Created When Computed Columns Exist

$
0
0

Explorations working with SQL Server never stop and I get an opportunity to learn something every other day. Today I thought of bringing pout some learning that happened to me by accident. As I was not sure and assumed certain things, these came as a surprise learning for me. So let us see what is the issue at hand, which is about Columnstore Index and Computed Column.

I was at a customer place and I was playing around with a performance troubleshooting on a SQL Server 2014 system. While we were doing this, the developer asked me if we can use a ColumnStore index for one of their history table which was large and they wanted to do some analytics on the data. This seemed like a classic candidate for this and I was confident is saying, please go ahead and it would work. At this point, the developer said that the index was not allowed on this history table.

This got me curious and then I said, can we setup the same together. For which the developer was completely excited because he was getting a free support beyond what was agreed upon. To simulate the same, see the script below:

CREATE TABLE test_tbl (id_col1 INT, compute_col2 AS id_col1 + 50 PERSISTED)
GO
CREATE NONCLUSTERED COLUMNSTORE INDEX NCCS_ind1 
ON test_tbl (compute_col2)
GO

This shows the error is clear text. It reads like below:

Msg 35307, Level 16, State 1, Line 1
The statement failed because column ‘compute_col2’ on table ‘test_tbl’ is a computed column.
Columnstore index cannot include a computed column implicitly or explicitly.

As it shows, this is something that even I was not aware and a moment of realization took the front seat. As you can see a non-clustered Index cannot be created when a computed column is present on the table.

I went a step ahead and even tried to create a clustered columnstore index to see if anything changes. Nothing different even now, the error message was no different even now. The same as before as shown in the figure below.

SQL SERVER - Columnstore Index Cannot be Created When Computed Columns Exist columnstore-computed-columns-01-800x337

I think this was a great learning for me because I fell for the assumptions created in my mind that the index was on a normal table. I understand now to gather all the requirements before jumping to conclusions.

Having said that, did you ever have a reason to create such indexes on your environments? What were those? Please share the same via comments.

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

First appeared on SQL SERVER – Columnstore Index Cannot be Created When Computed Columns Exist

SQL SERVER – Patch Installation Error: The version of SQL Server instance does not match the version

$
0
0

Applying a patch is something which is part of everyone’s life in the software industry. One of my clients reported below error related to Patch Installation Error.

The version of SQL Server instance <InstanceName> does not match the version expected by the SQL Server update. The installed SQL Server product version is 11.1.3000.0, and the expected SQL Server version is 11.3.6020.0″

They said that they are not able to move ahead of below the screen.

SQL SERVER - Patch Installation Error: The version of SQL Server instance does not match the version version-error-01

Here is the text of the message which is shown at the bottom of the screen: There are no SQL Server instances or shared features that can be updated on this computer.

I considered support articles and found that 11.1.3000 is service pack 1 and 11.3.6020 is service pack 3. When I asked about the patch, they told that it is CU2 for SP3.

I told them that to apply any CU of service pack, we first need to apply the base service pack. Once the installed SP3, then they could install CU.

SOLUTION/WORKAROUND

There could be two reasons of such error:

  1. Version of CU is not matching with the base service pack. Like the one which happened above.
  2. Same error can also appear if last patch was incorrectly installed. If that is the case, you can try to repair the instance and then retry the patch.

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

First appeared on SQL SERVER – Patch Installation Error: The version of SQL Server instance does not match the version

SQL SERVER – Fix Error Msg 35336 Working with ColumnStore Indexes

$
0
0

Since my consulting have started around performance tuning, I am able to see a number of customers who want to start using the new capabilities of SQL Server for their existing application as they plan to do an upgrade of their infrastructure. In one of engagement with a bank, who was upgrading their SQL Server 2012 to SQL Server 2016, they were interested in knowing how some of the new InMemory or even usage of ColumnStore Indexes can be used. It was an interesting conversation that started which I am using as a blog here.

I confronted them with the question on their inability to use a Non-Clustered ColumnStore index even in SQL Server 2012? They said they had evaluated and then saw that table was rendered read only once the Index was created. It made complete sense and as I planned for their session on a SQL Server 2016 developer edition, I said now the non-clustered columnstore indexes were actually now updateable.

To start playing with the demo, I just went about creating a table and then a non-clustered Columnstore index based on my memory of the syntax. It is sometimes customary for me to do the same to write code randomly in front of the customer. To my surprise, I got the following error:

Msg 35336, Level 15, State 1, Line 1
The statement failed because specifying a key list is missing when creating an index.
Create the index with specifying key list.

SQL SERVER - Fix Error Msg 35336 Working with ColumnStore Indexes NCCI-Error-35336-01-800x321

As you can see, the first reaction seeing the “Red” error message was that I was doing something terribly wrong. It was a face-palm reaction for me. But I took a deep breath and saw that the error message it had what I was missing. I changed the same code to the column key values as shown below, it just worked fine:

CREATE NONCLUSTERED COLUMNSTORE INDEX
t_non_clust_colstor_cci on t_non_clust_colstor (acc_description, acc_type)
WITH (DATA_COMPRESSION= COLUMNSTORE);

I couldn’t get over to why I did that code and on my way to the airport, I was trying to figure out the reason. Then it suddenly struck me that the key values are not applicable for Clustered ColumnStore Indexes and that was in my mind. Now I felt relaxed as I boarded the flight.

Thanks to SQL Server for guiding me with a self-explanatory error message. I am sure you have in the past seen a number of error messages for debugging made easier. Do let me know if you ever got to such hero moments and found yourself in a soup? Do share via comments.

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

First appeared on SQL SERVER – Fix Error Msg 35336 Working with ColumnStore Indexes

Viewing all 425 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>