Search

Monday, January 20, 2014

DMV to check SQL Server edition specific feature

There are some features of Server Server Database Engine which change the way that Database Engine stored information in Database Files. These features are restricted to specific edition of SQL Server. If a database is containing these feature than that database cannot be moved to some other edition of SQL Server (Which does not contain that Feature).You can use below DMV to find all edition specific features enabled in the current database. 

SELECT DB_NAME() AS [Database Name], FEATURE_NAME AS [Feature] FROM SYS.DM_DB_PERSISTED_SKU_FEATURES

This DMV can check below four feature: 
  • Change Data Capture 
  • Data Compression
  • Transparent Data Encryption
  • Partitioning


Monday, January 13, 2014

Error showing while opening SSMS 2012, Value cannot be null

Today when I was opening SQL Server Management studio in SQL Server 2012, I got below error:

Value cannot be null. Parameter name: viewInfo (Microsoft.SqlServer.Management.SqlStudio.Explorer)

To solve above problem I done below steps:


1. Open Windows Explorer, paste the %USERPROFILE% in the navigation bar,
or go to C drive --> Users --> Your user ID.

2. Go to the following directory My Documents\SQL Server

Management Studio\Settings and delete all the files exists there.

3. Restart the SQL Server management Studio.


And problem is solved.

Monday, January 6, 2014

Property Owner is not available for Database 'AdventureWorks'.

When I try to check the properties of the AdventureWorks database from SSMS. I couldn't able to see the properties of the database and i got below error.

Property Owner is not available for Database 'AdventureWorks'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.  (Microsoft.SqlServer.Smo)

To solve above error I had changed the database owner using below stored procedure.

USE AdventureWorks
GO
EXEC sp_changedbowner 'sa'
GO

Monday, December 30, 2013

The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine DI-ERP2 Error:2148007941 (0x80080005).

Today when I was trying to uninstall SQL Server If got below error:

TITLE: Microsoft SQL Server 2005 Setup
------------------------------
The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine MAIN Error:2148007941 (0x80080005). 

Than I searched the net and found below command file and I ran this and it fixed my WMI problem. Copy below content into notepad as save in C Drive root as fixwmi.cmd and then from a command line run c:\fixwmi.cmd.

It takes several minutes to complete and at points it appears that it is not running but it is. After it is complete, my problem is solved.

The content of cmd file is:

@echo on
cd /d c:\temp
if not exist %windir%\system32\wbem goto TryInstall
cd /d %windir%\system32\wbem
net stop winmgmt
winmgmt /kill
if exist Rep_bak rd Rep_bak /s /q
rename Repository Rep_bak
for %%i in (*.dll) do RegSvr32 -s %%i
for %%i in (*.exe) do call :FixSrv %%i
for %%i in (*.mof,*.mfl) do Mofcomp %%i
net start winmgmt
goto End

:FixSrv
if /I (%1) == (wbemcntl.exe) goto SkipSrv
if /I (%1) == (wbemtest.exe) goto SkipSrv
if /I (%1) == (mofcomp.exe) goto SkipSrv
%1 /RegServer

:SkipSrv
goto End

:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt

:End

Monday, December 23, 2013

SQL Backup job failed with exitcode: 880 SQL error code: 942 [SQLSTATE 42000] (Error 50000). The step failed.

When a database is offline and you try to take backup of that database than below error will show:

SQL Backup job failed with exitcode: 880 SQL error code: 942 [SQLSTATE 42000] (Error 50000). The step failed.

So, before running backup on any database, check whether the database is online.
Now to make database online, you can use below methods:

Method 1

use master
go
Alter Database <Database_Name> SET Online

Method 2

Open SSMS, select database, right click. Select Tasks and Select Bring Online.