SQL LocalDB Nightmare - sql-server-express

I'm having some serious problems with SQL LocalDB and Express for Web 2015.
I have a number of development workstations - all of which have had Express for Web 2015 installed from the same installer version and all of the machines previously had SQL Server Express 2008 installed.
When I try to load up my solution into Express for Web then subsequently open the database file from the App_Data folder, I run into the following error:
The database 'db1.mdf' cannot be opened because it is version 852. This server supports version 782 and earlier. A downgrade path is not supported
First and foremost, I'm unsure as to what the version 852 refers to - especially given that the versions reported by SQLLocalDB are in the form of xx.x.xxxx.x
I've looked at the version of LocalDB installed on my present workstation which is reporting back two versions as follows:
where sqllocaldb
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDb.exe
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\SqlLocalDb.exe
So this has lead me to believe that when I run a sqllocaldb command, its picking up the first executable from the first directory in the list.
When I check the LocalDB info, I get the following:
sqllocaldb info
MSSQLLocalDB
ProjectsV13
v11.0
XpoDemos
No idea what the bottom 3 are and presumably, I don't care. If I check the info on MSSQLLocalDB, I get this:
sqllocaldb info MSSQLLocalDB
Name: MSSQLLocalDB
Version: 12.0.4100.1
Shared Name:
Owner: <my user name>
Auto-create: Yes
State: running
Instance pipe name: np:\\.\pipe\LOCALDB#BF25386A\tsql\query
Which now indicates to me that the MSSQLLocalDB instance is being created with the latest set of tools installed with Express for Web 2015 yet Express for Web cannot and will not allow me to browse the database within the environment.
Can anyone help please?

Related

I want to migrate the list of users windows 2008 r2 to windows 2016

I want to migrate the list of my users from windows 2008 R2 to windows 2016.
I used "Windows Server Migration Tools" with the command
"Export-SmigServerSetting -User All -Group -Path C: \ -Verbose"
but the problem on the 2016 server when I place the order
"Import-SmigServerSetting -User All -Group -Path C: \ -Verbose"
it gives me an error
"Error: Import-SmigServerSetting: The migration operation cannot be performed. The versions of Windows Server Migration Tools on the source and destination servers are not the same. Please make sure that the same version of Windows Server Migration Tools is used on the source and destination server. "
can someone tell me where the problem is coming from.
Some time ago, I face the same issue in my case was from 2008 to 2012 and I could fix it following:
For context try to use the newer version, it means use the migration tool 2016,
Create deployment folder on W2016 destination server
Copy deployment folder over to W 2008 source server
Register W 2016 Microsoft server migration tool on windows 2008
source server

SQL Server LocalDB 2014 does not create a default instance at install

I've recently downloaded and installed SQL Server LocalDB 2014 from Microsoft from here:
Microsoft® SQL Server® 2014 Express
After installation, there is not a default instance in the
C:\Users\Administrator\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances directory.
But when I install 2012 version, it creates a v11.0 directory.
In 2014 case I should create an instance manually, but I want the default instance to be there automatically.
Any ideas for resolving this?
I found it.
If the MSSQLLocalDB folder is deleted some how from the Instances folder, it does not return when the SQL Server LocalDB 2014 is installed again.
But after installation, after first connection using the Datasource=(localdb)\MSSQLLocalDB connection string, the MSSQLLocalDB folder is recreated.
The default instance should be in : C:\Users\UserName\Local Settings\Microsoft\Microsoft SQL Server Local DB\Instances\MSSQLLocalDB Folder.
File Locations for Default and Named Instances of SQL Server.

Using SMO with VS2013 Windows Desktop application project

I am building a VB.NET application in VS2013 that uses a database created in SQL Server 2012 (which is installed locally and on the only computer that the application will be run on).
I need to execute a SQL script when the user clicks on a button. I know that I need to Import resources from SMO but when I run the SharedManagementObjects.msi installer I get a message that says,
"Installation of Microsoft SQL Server 2012 Management Objects failed
because a higher version already exists on the machine. To proceed,
uninstall the higher version and then run Microsoft SQL Server 2012
Management Objects Setup again."
What do I need to do to get SMO installed to use in my project?
I am assuming you are using nuget??
It appears that you must have 2014 installed, search for this in your installed packages and click uninstall. Now try and install the 2012 version.
Or in the Package Manager Console:
Uninstall-Package Unofficial.Microsoft.SQLServer.SMO.2014
Followed by:
Install-Package Unofficial.Microsoft.SQLServer.SMO
http://www.nuget.org/packages/Unofficial.Microsoft.SQLServer.SMO.2014/

Why does the SqlPublish target fail for a SQL Server 2014 database project?

My machine has the current (March 2014) version of SSDT, Visual Studio 2012 Professional, and SQL Server 2014 Developer. I have a SQL Server project (let's call it MyProject.sqlproj) that targets SQL Server 2014. I attempted the following:
MsBuild.exe MyProject.sqlproj
/t:SqlPublish /p:SqlPublishProfilePath=Somewhere.publish.xml
This fails with the following error:
Deploy error Deploy 72002: Internal Error.
The database platform service with type
Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider is not
valid. You must make sure the service is loaded, or you must provide
the full type name of a valid database platform service.
If I switch this project to target 2012 (and point to a 2012 instance), this same command runs successfully. I had previously asked a potentially related question, and the answer there resolved my problem then, but that's not the issue here -- I'm able to publish this 2014 DACPAC successfully if I use SqlPackage.exe directly.
What's happening, and how can I fix it?
The issue here is that the VisualStudioVersion environment variable isn't set, in which case the .sqlproj file currently defaults to targeting the VS2010 version (which does not support SQL Server 2014). Calling "set VisualStudioVersion=11.0" before running MSBuild will fix the issue.

How to install SQL Server 2005 Express in Windows 8

I tried to install SQL Server 2005 Express SP3 x64 on Windows 8 but the installer gives me an error:
An installation package for the product Microsoft SQL server native
Client cannot be found. Try the installation again using a valid copy
of the installation package 'sqlncli_x64.msi'
How can I solve the problem?
I had the same problem. But I also had to perform additional steps. Here is what I did.
Perform the following steps (Only 64bit version of SQL Server 2005 Developer Edition tested on Windows 8 Pro 64bit)
Extract sqlncli.msi / sqlncli_x64.msi from SP3 or SP4. I did it from SP4
Install sqlncli
Start SQL Server 2005 Setup
During setup I received an error
The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."
Don't click cancel yet. From an installation of SQL Server 2005 SP3 or SP4 copy SQLSERVR.EXE and SQLOS.DLL files and put them in your SQL install folder.
Click RETRY
For STEP 5 above: Although I didn't try looking into SP4 / SP3 setup for SQLSERVR.EXE and SQLOS.DLL but if you don't have an existing installation of SQL Server 2005 SP3/SP4 then maybe try looking into the SP3/SP4 EXE (Compressed file). I am not sure if this may help. In any case you can create a VM and install SQL Server 2005 with SP3/Sp4 to copy the files for Windows 8
I had a different experience loading SQL Server 2005 Express on Windows 8. I was using the installer that already had SP4 applied so maybe that explains the difference. The first error I received was when Setup tried to start the SQL VSS Writer. I just told it to Ignore and it continued. I then ran into the same error Sohail had where the SQL Server service failed to start. There was no point in following the rest of Sohail's method since I already was using a SP4 version of SQLServr.exe and SQLOS.dll. Instead, I just canceled the install rebooted the machine and ran the install again. Everything ran fine the second time around.
The place I found Sohail's technique invaluable was when I needed to install SQL Server 2005 Standard on Windows Server 2012. We have a few new servers we're looking to roll out with Windows 2012 but we didn't feel the need to upgrade SQL Server since the 2005 version has all the functionality we need and the cost to license SQL 2012 on these boxes would have been a 5-figure sum.
I wound up tweaking Sohail's technique a bit by adding steps to revert the SQLServr.exe and SQLOS.dll files so that I could then apply SP4 fully. Below are all the steps I took starting from a scratch install of Windows Server 2012 Standard. I hope this helps anyone else looking to get a fully updated install of SQL Server 2005 x64 on this OS.
Use Server Manger Add roles and features wizard to satisfy all of SQL's prerequisites:
Select the Web Server (IIS) Role
Add the following additional Web Server Role Services (note that some of these will automatically pull in others, just accept and move on):
HTTP Redirection
Windows Authentication
ASP.NET 3.5 (note that you'll need to tell the wizard to look in the \Sources\SxS folder of the Windows 2012 installation media for this to install properly; just click the link to "Specify an alternate source path" before clicking Install)
IIS 6 Metabase Compatibility
IIS 6 WMI Compatibility
Start SQL Server 2005 Install, ignoring any compatibility warnings
If SQL Server service fails to start during setup, leave dialog up and do the following:
Backup SQLServr.exe and SQLOS.dll from C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn
Replace those two files from a working copy of SQL Server 2005 that already has had SP4 applied (alternatively, extract them from the SQL Server 2005 Service Pack 4 distributable using 7-Zip, here's a helpful write-up.)
Return to setup, hit Retry and setup will now run to completion.
Stop SQL Service and restore orignal versions of SQLServr.exe and SQLOS.dll (or else SP4 doesn't think it is needed in the next step)
Install SQL Server 2005 SP4
Install SQL Server 2005 SP4 Cumulative Hotfix 5069 (Windows Update wasn't offering this for some reason so I had to download and install manually)
If you want the latest documentation, install the latest version of SQL Server 2005 Books Online.
Microsoft says the SQL Server 2005 it's not compatible with Windows 8, but I've run it without problems (only using SP3) except the installation.
After you run the install file SQLExpr.exe look for a hidden folder recently created in the C drive. Copy the contents to another folder and cancel the installer (or use WinRar to open the file and extract the contents to a temp folder)
After that, find the file sqlncli_x64.msi in the setup folder, and run it.
Now you are ready the run the setup.exe file and install SQL server 2005 without errors
I found that on Windows 8.1 with an instance of SQL 2014 already installed, if I ran the SQLEXPR.EXE and then dismissed the Windows 'warning this may be incompatible' dialogs, that the installer completed successfully.
I suspect having 2014 bits already in place probably helped.
install "SQL Express 2005 service pack 4" version "directly".
it contains sql Express 2005 inside . dont let the name fool you
runs succesfuly. from my experince
Microsoft SQL Server 2005 Express Edition Service Pack 4 on Windows Server 2012 R2
Those steps are based on previous howto from https://stackoverflow.com/users/2385/eduardo-molteni
download SQLEXPR.EXE
run SQLEXPR.EXE
copy c:\generated_installation_dir to inst.bak
quit install
run inst.bak/setuip/sqlncli_x64.msi
run SQLEXPR.EXE
enjoy!
This works with Microsoft SQL Server 2005 Express Edition Service Pack 4 http://www.microsoft.com/en-us/download/details.aspx?id=184