Portable SQL LocalDB or Express - sql-server

For the testing purpose I need to have SQL Server configured on each dev machine.
So once test suite or case is started SQL Server should be accessible locally.
I can not share the common server (this can not be changed)
Compact Edition doesn't fit requirements - we have cross-DB queries which are not supported
Better not to have any pre-requisites for the dev environment (e.g. install SQL Server Express) - it is not preferable
Is there any chance to have portable Express/LocalDB editions? To start it manually before the test and to stop after?

If you have a recent version of Visual Studio installed you will also have SQL Server LocalDB installed. And it is not a service, but a process that will start on demand from another process.

I had to do a job with similar requirements as yours, they wanted to install the application on several computers but they wanted to process the data locally, use of a remote SQL Server was not an option for them (the files that they wanted to process had some sensitive information).
The best option for me due to the requirements was to use LocalDB 2012 and add it as pre-requisite on the APP installer, is just a matter of a few clicks and boom you have LocalDB 2012 working on that machine (the LocalDB MSI installer it's ~70mb).
Of course i had create the database and stored procedures if the database was not creater yet on that machine, nothing that you cannot when you start the application, hope it helps.

Related

Deploying Windows application with SQL Server database

I have a WPF project and I will use SQL Server database. The instance of SQL Server IT created for me is SQL Server 13 (2016 standard version) on a remove server. When I’m deploying the application on a client’s computers, what version I need to install there as a prerequisite? Can I deploy SQL Server Express 2016 on a client’s computer and access the remove SQL Server Standard edition? I am looking for a simple solution and for a lighter version I need to install on the user’s computers. I cannot install a full SQL Server on each user.
I have searched the net and a similar question has been asked many times, but I didn’t find a clear answer before. Many people started their SQL Server experience using local type databases, like SQL Server CE or LocalDB. In this case specific DLLs and redistributables must be added with the installation program. It is hard to understand at the beginning, but when an instance of SQL Server is on a remote server, this is a different story. Everything is happening on this remote server. There is no need of any SQL Server instances on a client’s machine. Just a connection string must be added. The adapter or Entity Framework will take care of everything else.

Doing clean install of SQL Server Express

I installed VS 2008, VS 2012 and the community version 2013 along with the matching SQL Servers but never needed the SQL Servers and never checked if they were properly installed.
I recently picked up SQL Server Management Studio and tried to connect to a server.
Unfortunately, it does not detect any local server, even though I have about twenty different entries in programs & apps for SQL Server related stuff including SQL Server 2012 and 2014 Express Localdb, an installation of SQL Server 2008, data-tier app frameworks, native clients, transact SQL, a couple "compact" versions, tools and what's not.
One would think that something in this mess would be recognized as a server, but apparently not so. I had an entry for SQL Server in the start menu with a nice GUI with an install DB option... that requested a server media folder (lord knows which). I tried starting manually one of the many SQL Servers (sqlservr.exe) from the program files folders to no avail (I get a message about a corrupt installation)
My DB experience is pretty much exclusively with MySQL and I am lost with all these applications that look like they should do something but don't.
I would like to have a bare bones installation that works for the following use:
Coding Winform apps with local databases (compatible with Entity Framework)
Allows to distribute the apps with local databases for free (commercial use, small data volume)
Running SQL queries from SQL Server Management Studio
What is the minimum I need for this purpose?
Should I uninstall all the existing SQL Server related programs and make a clean install from a single install file (for instance, would installing the 1.1gb SQL Server 2014 Management Studio Express 64 Bit.exe give me all I need)?
Or if not, is there any way to install a recent version and ignore the underlying mess? (I don't really care for the disk space, I just want this thing to work).
I apologize if this question is a mess but I am pretty confused with this, and I could really use a hand figuring out what's what.

Can a WPF app with .sdf database run on a computer without SQL Server installed

This question may seems a bit silly. The thing is I'm programming a WPF using VS2010, which contains a .sdf database (connection is ADO.NET).
Someone told me that if I use a SQL Server Express database it can be run on any PC even it has no SQL Server installed. But after I tried executing in my virtual machine (win7 & win xp), seems it cannot even start up.
So, can someone brief me, what database do people normally use in developing WPF software? Is it true that my program using a SQL Server database file cannot execute on PC without SQL Server installed?
Much appreciate in advance!
Yes, it can!
SQL Server Compact (that produces and uses .sdf) is the only SQL Server edition that does not require a server to be installed. All its code and logic is contained in the handful of DLL's that you need to include with your application. Just ship your app with those DLL's and you should be fine.
Read more about SQL Server Compact and how to use and deploy it on MSDN.
SQL Server Express (and any of the other editions, like Web, Standard, Developer, Enterprise) on the other hand does require an installation of the SQL Server Express edition - either on that machine, or somewhere in the network where your app runs (remote connections from the network are disabled by default, but can be enabled).

Embedding SQL Server into a .NET application

Hey, I've just finished writing a VB.NET application. Now I want to package the executable and the database ofcourse into a single installer file. I tried using QSetup, InstallShield to make SQL Server embedded into the setup file, and finally after hours of try&fail I have no idea. Anyone?
You can do a rightmouse on the properties of your Visual Studio Setup Project, and then there is this button 'Prerequisites'. There you can tick 'SQL Server Express ...' Or the 'SQL Server Compact 3.5'
link to image
You're probably best off just to set the connection file directly to the mdf, and attach it when the program is run. This is easier as it doesn't require a custom setup script to install the database to the database directory itself.
Note: Consider using the Compact Version, it's smaller, people don't like a full blown engine on their computer :)
InstallShield has a concept called Setup Prerequisites where you can teach it how to install additional packages along with your own. In older versions this would happen before calling your MSI. In newer versions you can have a "Feature" prerequisite where the prereq can associated to a feature and only installed if that feature is selected to be installed and after it's been selected but still before the main activity of your MSI occurs during the install execute sequence.
InstallShield also has a pattern for executing SQL scripts against your database instance so that you can then load your database into your newly installed instance.
All of this is quite powerful but it does take a bit of digging to learn.
As far as I know, anything but the SQL Server Compact Edition (SQL Server CE) cannot be embedded into your setup, really. Microsoft doesn't want that - you need to have SQL Server Express installed separately - any other edition can't even be shipped with your software (the client must have a license and installation separately).
You can indeed distribute SQL server with your custom application:
http://msdn.microsoft.com/en-us/library/bb264562(SQL.90).aspx

Installing support files for app using sql 2005 where server is on another computer

I have a managed C++ application that connects to SQL Server 2005 Express databases on the same computer and over a network. My problem is that if the database is located on another computer over the network, the client machine will not have the needed DLLs files installed from SQL Server.
I can't force my users to install SQL Server 2005 Express on the client machine just to get the needed support files. So my question is, is it safe to installed the dependent files to the GAC on the user's computer? Or, does MS have a command line install package for just this purpose?
The files from SQL Server that my application show as being dependent on are as follows:
Microsoft.SqlServer.BatchParser
Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.RegSvrEnum
Microsoft.SqlServer.Replication
Microsoft.SqlServer.Rmo
Microsoft.SqlServer.ServiceBrokerEnum
Microsoft.SqlServer.Smo
Microsoft.SqlServer.SmoEnum
Microsoft.SqlServer.WmiEnum
If it helps, I'm using the Inno-Setup program for my installer. This has to be a common problem.
You dont have to install the full version of SQL Server, but you do need the necessary drivers. Installing the SQL 2008 SMO package on the client should resolve these issues.
http://www.microsoft.com/downloads/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en

Resources