Downgrade from SQL Server 2014 Express to SQL Server 2012 Express - sql

I had SQL Server 2012 Express installed on my PC at work, but we received a file from a client the was created in SQL Server 2014. Please keep in mind, I am newbie, and I only made this mistake about 7 months ago
I tried to install SQL Server 2014 Express as another instance on my PC along with SQL Server 2012. After noticing that my new SQL Server instance did not work and my old SQL Server did not work, I looked online and found that what I did was a step up from what an ape would do. Always read before attempting an install.
After un-installing SQL Server 2014 I tried to relaunch SQL Server 2012, but it would not connect to my instance that I was able to just before.
I now get this error:
Cannot connect to STID02\SQLEXPRESS.
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) (.Net SqlClient Data Provider)
I have also read this thread Can't connect to SQL Server 2014 Express and found that the SQL Server service is stopped and I cannot start it, and the SQL Server Agent Service is stopped and won't start either.
I have not been effected by this until recently, I need to do some testing with DB's but I need my local instance to do the testing. I would appreciate any advice, as I am still new to SQL Server and most computer related things I would be very thankful to those how can dumb it down extremely low.
Thank you -Anthony

In short, uninstall everything, then reinstall the version you want to use.
Some configuration files must have been overwritten by SQL Server 2014. Don't worry, it can be fixed.
First: do you need any of your existing databases? I assume not as you haven't been using SQL Server for the last 7 months. If you do need some of the databases you'll find the .mdf, .ldf files in you SQL Server installation folder somewhere in the DATA folder.
Then: Uninstall SQL Server 2012 - note that since you've corrupted your current installation it might happen that some registry entries will be bad and/or services or libraries won't be removed. In that case fix the registry entries using some tool, like CCleaner, and try again to remove those programs/services.
Last step: reinstall whichever version you want. If you needed your previous databases overwriting the new mdf/ldf files should do the trick (of course while the server is not running). You can check the server's state from the SQL Server Configuration Manager or from Services.

Related

Deploy SQL Database to MS Azure Storage - Error: 40804 [duplicate]

I'm trying to move my databases to a newer Azure subscription. I used to simply click "Deploy to Azure" on a local database from SSMS and have it deployed to a specified Azure server. Importing/Exporting a BACPAC file also works. However, I can't seem to do any of this on the new server. I keep getting the error:
"The service objective 'Web' specified is invalid."
Googling around, I found this thread explaining the need to update the CREATE DATABASE template to accommodate Azure Databases (Azure upgrade, I'm guessing). However, the hotfix provided is specifically for SQL Server 2014 and I'm using SQL Server 2012. I checked other cumulative updates for 2012 here but found no fix for the issue.
Is there any other way I can fix this without having to upgrade to 2014?
Just to summarize my software versions:
SQL Server 2012
SQL Management Studio 11.0.2100.60
Local database: SQL Server 10.50.16000
Old Azure server: SQL Server 11.0.9230
New Azure server: SQL Server 13.0.15
You are getting this error because the latest V12 servers are not supporting the Web and Business Editions anymore. If you don't want to upgrade to SSMS 2014, you can create a V11 server and import your DB on this server. However this is only a temporary solution as Web and Business edition databases will be retired in September. At this point you will have to work with the latest tools to avoid this problem.
There is a Hotfix for it you can download and install on your machine. Please navigate to:
https://support.microsoft.com/en-gb/kb/2936603
You need to enter your email then download link will be sent to your email address. Then install it on your machine and you can see the following options:
Install the database as a Data Project into Visual Studio,
Set the target framework in the properties window to SQL Azure,
Build the project and resolve any unsupported issues.
Publish to your azure site.
I have tried the above and did not work for me - this solution worked!

SQL Server 2012 Database restore error

I am trying to restore a database backup from SQL Server 2008 R2 to SQL Server 2012 Standard. It keeps failing with the error seen here: http://screencast.com/t/UWC58GrVnWI
The web server is: Windows Server 2012
I tried renaming the file.
I tried to restore on another server
on SQL 2012 and it worked fine
I tried to restore on another
server on SQL 2008 R2 and it worked fine.
Considering above symptoms, I strongly feel the database .bak file is good. It only fails on this web server. What might be the reason?
If you read the error message you will find out that it is clear - the location is invalid. Now, if you check the path of folders and know the basics of how windows file systems work.... guess what, you find out that this is exactly true.
Fix the location. Done.

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.

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.

Problem connecting VWD Express 2008 to SQL Server Express 2005

WHen i try to connect to SQL Express 2005 from Visual Web Developer Express 2008, i was getting errors like 'Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc' .
I read some posts which advised me to download and install 3 applications to address above issue ( SharedManagementObjects.msi, sqlncli.msi,SQLSysClrTypes.msi ).
I did that and now i get a different connection error
'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) '.
Does anyone know a way of overcoming this ?
Thanks.
How are you trying to connect ? Just a regular ADO.NET connection? If so, what's your connection string?
Are you trying to use SMO (SQL Mgmt Objects)? This sounds like some of your SMO objects aren't available for some reason - you might want to download and reinstall those SMO components from here. The files you want are quite a bit down the page, under the heading of "Microsoft SQL Server 2005 Management Objects Collection" - files are called "SQLServer2005_XMO.msi" (with some x64 variations).
Does installing that MSI help at all?
Marc
PS: okay, thanks, based on your comment - can you try this connection string here:
string connectionString = #"Server=.\SQLEXPRESS2005;Database=DBName;Integrated Security=SSPI";
If you are running SQL Sever Express locally another thing you may want to do check in the Services console (WinKey, Run, 'services.msc') and verify that you have SQL Server and SQL Server Agent entries and that they are both running.
I think this problem is certainly with your connection string. Try doing this
Run the SQL Management Express, and get the server instance name from it.
Usually this problem occurs when the server instance name is wrong (on many computers it could be SQLEXPRESS).