System error 5 while setting up SQL server on share - sql

I am trying to setup a SQL server on a local share. I am doing this because it is too expensive at my organization to buy a SQL server. I followed steps from:
https://stackoverflow.com/questions/12881455/sql-server-database-on-network-share
this is being done on Microsoft SQL server
Now, when I write in SQL server management studio (2012)
xp_cmdshell 'net use I: \\ShareDriveLocation'
I get a System error 5 has occurred, like below:
System error 5 has occurred. NULL. Access is denied. NULL. NULL
I have access to this share and I have even tried to map it on the work space I am working, still the same error.
I am working on a windows 7 machine and I connect to SQL server management studio with the name of my work space (DVVDI1234\SQLEXPRESS)

I would advise running SQL Server Management Studio as administrator.
The error suggests that the application doesn't have permission to do this.

Related

Error starting SQL Server configuration manager

Trying to open SQLSTD configuration file, but can't access it. Anything am doing wrong here? I have all the permission
Error message when you open SQL Server Configuration Manager in SQL Server: "Cannot connect to WMI provider. You do not have permission or the server is unreachable"
Please help
MS KB shows some cause and fixes as well
Cause:
This problem occurs because the WMI provider is removed when you uninstall an instance of SQL Server. The 32-bit instance and the 64-bit instance of SQL Server share the same WMI configuration file. This file is located in the %programfiles(x86)% folder.
Resolution:
run below commmand in command prompt
mofcomp "%programfiles(x86)%\Microsoft SQL Server\number\Shared\sqlmgmproviderxpsp2up.mof"
Your number depends on version you are using
Microsoft SQL Server 2012 110
Microsoft SQL Server 2008 R2 100
Microsoft SQL Server 2008 100
Microsoft SQL Server 2005 90
Re-installation of sql server worked for me

SQL Server 2008, Error: 948 While Attach Database got Version error?

Yesterday I installed SQL Server 2008 on my laptop (Windows 7 64 bit), I need to attach a .mdf to the server, but when I try to do this, I get this error:
Attach Database failed for server 'prince/sqlexpress' (Microsoft.SqlServer.smo)
ADDITIONAL INFORMATION:
1.An Exception Occured while executing a Transact Sql statement or Batch (Microsoft.SqlServer.connectioninfo)
2.Unable to open the Physical file Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)
With the help of Internet, I found some solution.
1.Start SQL Server manager as Administrator (right-click on the program, choose "Start as administrator"):
But I still got the same error.
That .mdf file does have have permission, so I moved into external drive (pendrive because my system have only C:\ drive, yet no partition I have done ) .
Then I got another error,
Attach database failed for Server 'Prince\SQLEXPRESS'.
(Microsoft.SqlServer.Smo) ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or
batch. (Microsoft.SqlServer.ConnectionInfo)
The database 'Databasename' cannot be opened because it is version
655. This server supports version 611 and earlier. A downgrade path is not supported. Could not open new database 'Databasename'. CREATE
DATABASE is aborted. (Microsoft SQL Server, Error: 948)
I use the Query -
"select ##version;"
I got the Output as
"Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007
22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition
on Windows NT 6.1 (Build 7600: )"
what shall i do? But i installed SQL Server 2008. how do i change that?
How to solve this error, please help out this problem, If you have any solution please post it.
The message is very clear: the database MDF file is version 655. Your server understands version 611. Which means, despite to your claim to the contrary, that you are connected to a SQL Server 2005. Install a SQL Server 2008, connect to it, and attach your database. Please pay attention during the installation process to the instance name you choose and make sure you connect to that instance. You can also check now what instances you have installed, look at what services you have on your system. MSSQLSERVER will be the default instance, MSSQL$<instancename> will be a named instance. Use any SCM query tool to see what services you have installed, eg. sc.exe.
Microsoft SQL Server Management Studio needs Administrator rights to attach database in Windows 7. If you execute it directly so you will get the error 5120. Fix this executing Management Studio icon using the right mouse button and selecting execute as administrator. Good luck.
Finally I Solved My Problem,
Stop the SQLEXPRESS service and Uninstall all the Components related to SQL server 2005.
Then Open the registry Editor Go to HKEY_LOCAL_MACHINE--SOFTWARE--MICROSOFT--MICROSOFT SQL SERVER-DELETE the folder 90. Then again reinstall SQL Server 2008 and create new instanse for 2008 server. Now its working, I m able to Attach the mdf file.

SQL Server 2008 R2 First Time Login

I've just started work on a new computer in which I had to download all the software fresh.
I've just download a copy of SQL Server 2008 R2, and I'm trying to connect to SQL Server Management Studio without success. I vaguely remember last time I installed this, it asked me to choose between windows, or sql server authentication, however this didn't happen for this installation.
If I try to login via Windows Authentication (where the username and password fields are greyed out, localhost as server name) it gives the following error:
"A Network-related or instance
specific error occured while
establishing a connection to SQL
Server. The server was not found or
was not accessible. Verify that the
instance name is correct and that SQL
Server is configured to allow remote
connections. (provider: Named Pipes
Provider, error: 40 - Could not open a
connection to SQL Server) (Microsoft
SQL Server, Error: 2)"
I have checked everything in SQL Server Configuration Manager, and everything bar VIA is enabled.
If I try SQL Server Authentication, It asks me for a username and password which I definiately have not set yet. Also, under SQL Server Services in configuration manager, there is nothing there.
Any help would be appreciated :)
Thanks
PS: I don't know if it's worth mentioning but I am running Windows 7 as a virtual machine on a Mac.
Are you sure you have the correct instance name? If it was SQL Server 2008 R2 Express Edition then the default instance name is .\SQLEXPRESS.
Also if your using sql authentication to connect try running sql management studio as admin, if you are a limited user your identity might not be mapped to an account in sql server yet but i believe the Administrators user group is.
You need to check if your services are running.
Please type
net start mssqlserver
in your command prompt. Then try to login.
Ended up reinstalling completely and doing a fresh install from a fresh download. When I did this I was brought through the steps of selecting the default instance, and selecting authentication modes.
Working fine now :)
After checking tons of sites looking for an answer to this question, I think I have a simple solution.
Open the sql Server Configuration
Click on the sql server services node
Right Click on Sql server
Click Start.
I have been screwing around with this forever, and this simple method actually worked.

Receiving permissions error in sql server 2005 dev edition installed on windows 7 when trying to attach a database

I am trying to attach a SQL Server 2005 database to an instance of SQL Server 2005 Developer Edition (w/ SP3) installed on Windows 7 Professional. I am getting a permissions error.
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "D:\FolderName\DatabaseName.mdf". Operating system error 5: "5(Access is denied.)".
I have also tried attaching this database to a SQL Server 2008 Developer Edition instance on the same machine with the same results.
Does anyone have any ideas on how to fix this?
you need to give read access to the file, i sure that database was in another Windows, so you need to give it permissions to read and write. I have attempted un-checking the ReadOnly attribute and that works for me.

SQL 2005 express with 2008 express compatibility

I installed VS 2008 without SQL 2005, then I installed SQL 2008, then I needed 2005 express so I reinstalled VS checking the SQL feature.
The installation went OK, however I still cannot open mdf files from VS.
I think there is no 2005v instance installed.
When I dbl-click an mdf file in VS I get the following message:
Connections to SQL Server Files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL: http:go.microsoft.com/fwlink/?linkID=49251.
Update
I tried to attatch it, it doesn't work.
When I tried to attach it to SQL 2008 it doesn't work, when I try to attach it to SQL inside VS, I get the following error message:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I suspect that SQL 2005 doesn't have any instance at all.
I opened SS manager and I didn't see any installed instances.
I don't know how to install an instance, or else if there is a way to open with 2008 tell me.
Any help will be really appreciated!
You don't just "open" an mdf file in Visual Studio - you need to "attach" the file to your SQL Server instance, then access it by creating a SQLConnection (System.Data.SQLConnection) from your VS application. See here for more info on attaching databases (note the FOR ATTACH option), and here's a good intro on accessing SQL Server data using a SQLConnection.
Oh, and if you should happen to see anything about "user instances", pretend you didn't. It was supposed to make auto-attaching databases easy (in fact, attaching databases isn't all that hard anyway). Microsoft is warning that the feature will be discontinued in later releases of SQL Server, so you're better off just learning the "right" way to do it.