SQL Server Configuration Manager - Cannot connect to WMI Provider - sql-server-2016

I am trying to run the SQL Configuration Manager and get this error:
The typical solution is not working. Nor are any of the associated ones: running cmd as admin or changing mofcomp to mofcomp.exe. I keep getting an Access denied, 0x80070005 error despite having granted full control to sqlmgmproviderxpsp2up.mof as well as its parent folders to the users & admins on the computer.
Please help.

Navigate to your SQL version’s shared directory (cd ):
SQL 2008: C:\Program Files (x86)\Microsoft SQL Server\90\Shared\
SQL 2008 R2: C:\Program Files (x86)\Microsoft SQL Server\100\Shared\
SQL 2012: C:\Program Files (x86)\Microsoft SQL Server\110\Shared\
SQL 2014: C:\Program Files (x86)\Microsoft SQL Server\120\Shared\
Then run the following command:
mofcomp sqlmgmproviderxpsp2up.mof

Related

Could not load package from "...\sql\debug\database.bacpac"

I have built my database project for SQL Server 2012. And I am using following command to prepare deployment script,
"C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe" /Action:Script /TargetDatabaseName:DacPacTest1 /TargetServerName:"demo2012util" /SourceFile:"C:\some\path\DBProject\Database\sql\debug\Database.dacpac" /op:"C:\some\path\DBProject\test2.sql"
I am getting this error
*** Could not load package from 'C:\some\path\DBProject\Database\sql\debug\Database.dacpac'. Could
not find a part of the path
'C:\some\path\DBProject\Database\sql\debug\Database.dacpac'.
It appears that I might have wrong database target and this error is because of that, but I have verified that I have built project using SQL Server 2012 as target and SQLPackage.exe is also same SQL Server version (110).
Any suggestions?

Restore BacPac database backup in sql server 2014

I have database backup file with extension .bacpac so how can i restore it in sql server 2014 ?
Two options:
In SQL Server Management Studio, right-click on the Databases folder in the Object Explorer tree. Then click on "Import Data-tier application". The wizard will guide you through the process.
From the command line, run this command: "c:\program files (x86)\Microsoft sql server\120\dac\bin\sqlpackage.exe" /a:import /sf:"PATH_TO_YOUR_BACPAC_FILE" /tcs:"Data Source=YOUR_SERVER_NAME;Initial Catalog=NEW_DATABASE_NAME;Integrated Security=true"
Aside: Note that the example connection string in the command line option above assumes you're using Windows Authentication instead of SQL Server authentication to access the server.

Unable to connect to SQL Server 2008 R2

I am unable to connect to a local SQL Server 2008 R2 trial version from Visual Studio 2010 Express.
When adding a new connection, I browse to the database file in this location:C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\AdventureWorks_Data.mdf, I encounter this error:
Could not open new data base 'C:\PROGRAM FILES\MICROSOFT SQL
SERVER\MSSQL10_50.SQLEXPRESS\MSSQL\DATA
ADVENTUREWORKS_DATA.MDF'.CREATE DATABASE is aborted. An attempt to
attach an auto-named database for file C:\Program Files\Microsoft SQL
Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA AdventureWorks_Data.mdf
failed. A database with the same name exists, or specified file cannot
be opened, or it is located on UNC share. File activation failure.The
physical file name "C:\Program Files\Microsoft SQL
Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\AdventureWorks_Data_log.ldf"
may be incorrect.
The log cannot be rebuilt when the primary file is read-only.
Another guess, you don't by any random chance have another user logged into the same machine that would have the DB file locked by connecting to it in the same way you say you're trying to? I'd imagine the previous comment about that database file already being attached to by the sql service is probably far far more likely, but just for wild chance I'm leaving my idea here for you or anyone else who happens by

SQL Server 2008 installed, though running version is still 2005

A while back I installed SQL Server 2008 on a development machine which already had Sql Server 2005 express from Visual Studio. When I look in my programs, I see 'Microsoft Sql Server 2008', which contains the management studio, etc. As well I can see 'MS Sql Server 2005'.
When I run a query in Management Studio 2008 to select the version running on my machine, it comes up as 2005, and leaves me scratching my head. When I look in the configuration manager, all I see is the SQLEXPRESS instance running ...
Are there any "quick" solutions to get 2008 running instead of 2005, considering 2008 is installed?
If your using the SQL Server 2005 Configuration Manager you will only see 2005 instances and lower.
To view instances of SQL Server 2008 you will want to make sure you are using SQL Sever 2008 Configuration Manager.
The final option would be to View All services using the Service Control Manager. Here you will need to look at what instances of SQL Server you have running on the machine.
If you want to find all the instance names, one way is to run powershell and execute the following
PS C:\> gwmi win32_service -filter "name like 'MSSQL%'" | fl DisplayName, pathname
For me the result is
DisplayName : SQL Server (SQLEXPRESS)
pathname : "c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\B
inn\sqlservr.exe" -sSQLEXPRESS
DisplayName : SQL Server (SQLEXPRESS2005)
pathname : "c:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Binn\sqlserv
r.exe" -sSQLEXPRESS2005
DisplayName : SQL Full-text Filter Daemon Launcher (MSSQLSERVER)
pathname : "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\
Binn\fdlauncher.exe" -s MSSQL10.MSSQLSERVER
DisplayName : SQL Server (MSSQLSERVER)
pathname : "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\
Binn\sqlservr.exe" -sMSSQLSERVER
DisplayName : SQL Server Active Directory Helper
pathname : "c:\Program Files\Microsoft SQL Server\90\Shared\sqladhlp90.exe"
DisplayName : SQL Active Directory Helper Service
pathname : "C:\Program Files\Microsoft SQL Server\100\Shared\SQLADHLP.EXE"
DisplayName : SQL Server Analysis Services (MSSQLSERVER)
pathname : "C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\bi
n\msmdsrv.exe" -s "C:\Program Files\Microsoft SQL Server\MSAS10.M
SSQLSERVER\OLAP\Config"
Look for the one that has MSSQL10 and make sure that the service is started. Then use that instance name when connecting via SSMS.
If for some reason you didn't install into the default structure you can always visit the Exe directly and check its version for something like 2007.100.xxx
I happen to have 2005 and 2008 express as well as 2008 standard
If I was better at PowerShell I would have piped the PathName to get the version info

SQL Server 2005 backup restore failing (with folder permissions)

I am trying to restore a database (from file thedb.bak). I am using SQL Server Express edition 2005 on a Windows 7 Ultimate 64-bit machine.
When I try to restore I get the following error:
System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL.2\MSSQL\Thedb.MDF'. (Microsoft.SqlServer.Express.Smo)
My username (antoniocs) is an Administrator. I have edited the permissions in the folder (C:\Program Files (x86)\Microsoft SQL Server\MSSQL.2\MSSQL\) so that the user AntonioCS has full control.
I really need to restore this backup. What am I missing?
Note: I am using the Windows authentication to login. Should I try another user (the one I use is an administrator in the machine)?
The account running the SQL Server service requires permissions on that folder.
You may be connected to SQL Server, but actions are done in the service account context: not you.
Run services.msc from command line, see what account is used, permission this folder accordingly.
Do you have a database that uses Thedb.MDF? I ran into this error when I tried to restore a database over a file that SQL Server used. From the restore window, choose Options and change the path or the filename from the "Restore the database files as".