Redistributable local database for windows desktop app - sql-server

I am getting a little bit confused about the difference of the followings:
SQL Server Express
SQL Server Compact
localDB
My requirement is to develop a desktop application that will use basic RDBMS features. I need to package the application and allow the user to install a single distributed package. I don't want the user to install even SQL server express.
In this case, which DB I should use? SQLite is not considered as too much re-coding has to be done.
Thank you.

SQL Server Express is full featured DBMS, with some limitations in terms of database size and resources it is allowed to use. You can see it's limitations (relative to SQL Server) on microsofts site (Features Supported by the Editions of SQL Server 2012)
SQL Server CE is embedded database, meaning that it runs in user mode, it's easy to deploy (requires you to copy just few assemblies), lightweight but fast, can be run by a low privileged user. It's supported by NHibernate. However, has more limitations. To me most notable is that there are problems when you try to have multiple connections to same database. Although MS claims that this is supported, if you try this in Windows 2008 server, you will fail. And what's worse, such use scenario may lead to DB corruption. This means that you will effectively not be able to use some Management tool to update data while your service/website is running. Also, SQL Server Management studio doesn't support SQL CE anymore, so you will have to use a 3rd party tool, like Database.NET. It also does not support subqueries.
localDB, having not used it, sounds like a compromise. It's a standalone database which is executed in user mode (can be used by low privilege user), but must be installed so you will need administrative privileges for that part. Offers set of capabilities of SQL Server Express. It's much larger than SQL CE, and also requires to be installed (unlike CE which is just binary drop in). Shortest overview of this DBMS can be found here.

Related

How Can I Use A SQL Database Like I Used To Use Access?

I have been supporting a product written in VB6 with an Access database for a long time. In many of the installations a mapped drive was used to allow multiple workstations to run simultaneously. Since it seems Microsoft has broken that recently, I need to re-write everything with a new set of tools.
I plan to use VB.net and I would like to use a SQL database this time for the stability. The problem is that the market I sell to cannot / will not support installing full blown SQL Server and all the complexities of managing it.
What I am not able to find any current info about is whether or not SQL Server Compact still exists, whether or not it can be added to a NON web based project and if it will be easy to deploy and be easy to manage like an Access database was.
When I try to follow the directions to add SQL Server Compact to my project, it isn't available in the Data Source drop down list (there are "Simple by ErikEJ" versions listed but they don't seem to work) I have seen SQL Server Compact talked about with regards to web projects but I am building a locally installed .exe. I can't find ANY current info about what flavors of SQL are available right now to add to a local program running over a peer to peer network.
SQL Server Compact is no longer supported and developed by Microsoft, I suggest that you use SQL Server Express, it allows remote connections (if configured to allow it) and has modest resource requirements. Supports a database up to 10 GB of size.
As suggested, SQL Server CE can still be used but is no longer supported. For file-based databases, Microsoft currently recommend SQLite.
For a multi-user system, SQL Server Express is probably your best bet. It's still server-based though, so the server needs to be installed somewhere. For local databases, you can install on the same machine as the application and attach a data file on demand. For multiple clients, you'll need the server installed on a machine accessible to all and a permanently-attached database.

Which one is Azure SQL Server for production?

As the graph shows above. Which type of sql server edition is for the production? I know the "Developer" version is for the development. Also I already got the Azure VM and have the "Developer SQL Server" on my VM, how can I install the production SQL Server in my VM? Is this free?
My purpose is to make a production SQL Server database. Is there two options for me? One is install a production SQL Server in my VM, another is to create a new Azure SQL database. Which one would be the best way to do this?
As the graph shows above. Which type of sql server edition is for the
Production? I know the "Developer" version is for the development.
Also I already got the Azure VM and have the "Developer SQl server" on
my VM, how can I install the production sql server on my VM? Is this
free?
Developer is not licenced for production - you aren't allowed to use it for production purposes.
Express is licenced for production but if your database gets bigger that 10Gb then it is unsuitable for your use
My purpose is to make a production sql server database. Is there two
options for me? One is install a production sql server on my VM,
another is to create a new Azure SQL database. Which one would be the
best way to do this?
"Best" doesn't mean anything. What are your constraints? Are you creating a brand new database? What tools will be connecting to and using the database? Does it need to be accessible from the internet?
If this is a brand new application / database, and you have limited capability for maintaining a VM then I definitely recommend using SQL Azure instead of a VM
Most importantly, and based on you other question, make sure you understand the term "Production"
Can Azure SQL Server on VM be the production database?
For example, you usually don't provision a 'production' environment without also provisioning at least a dev environment.
It would also help to give us some background on "My purpose is to make a production sql server database". It sounds like this is a request someone has given you but maybe you don't fully understand the term 'production'
None of them are sql azure. They are all sql server on premise on a virtual machine on azure.
If you want to add a sql server azure, you go on your main azure portal page, then on the left panel at the top "create a resource", then chose "SQL Database" on the popular column. Then follow instructions.
If you want as less pain as possible, clearly choose sql azure instead of a sql server on premise on a virtual server on azure. It is by very far the only reasonable choice if you work on azure: cheap, strong, backup automatically done, disaster recovery extremely easily applicable without any prior setup, extremely easy to up size its capacity in case of overload, perfectly secured without any prior setup either.
The only problem of this is the security: it can be accessed only by recognized IP addresses that you mention on the azure portal. So typically, you mention the IP address of you development computer. If your website is on your azure subscription as well, you don't need to worry, it will go through the azure firewall with no setup.
If you reeeeeeally want to use a sql server on premise, well, don't use the developer edition. If you want to avoid performance and load issues, don't use express. The entreprise is very complete, but not useful in most of cases for simple application (like web applications).
If you want most of features, go for the Standard edition, if you want to keep focused on the database engine for your web application, go for the Web edition.
Finaly, if you wanna have a licence free edition on a virtual server, the express is free of charges, but not powerful and extremely limited. The developer edition is free of charges as well and contains every possible and impossible features of sql server. The only pb of this edition is that you are not allowed to use it in production. Only for tests and developments.
As you are already having Azure VM with Developer edition installed you can go for either of the below options.
If you are comfortable to manage the Azure VM yourself, go for IAAS(Infrastructure as a Service) approach: Install SQL Server Standard Edition or SQL Server Enterprise Edition (based on your application needs). Read the capability difference between them. If SQL Server Express edition would be suitable for your needs, then install the same. It does have limited features and many constraints. See the scalability support for different editions in the same link above.
If you want to offload the database server management, go for PAAS(Platform as a Service) approach: Create a Azure SQL database and point your application to it. Azure SQL database is more like SQL Server Enterprise Edition with some limitations like CLR not being supported. Read Azure SQL database differences with SQL Server editions

How to password protect database that is created using Entity Framework Code First?

The title says it all: as we are nearing release of our desktop application, which uses a local database (SQLServer 2014 LocalDb), we want to password protect access to it.
The database will be created using EF Code First on the user's computer the first time he starts up the application.
This must be really simple, but I seem to overlook the solutions that should present itself on Google.
The short answer here is you can't password protect LocalDb. LocalDb is designed to be a low friction database setup for development and testing, but it does not provide any of the advanced features of SQL or even SQL Compact Edition. From MSDN:
LocalDB is created specifically for developers. It is very easy to install and requires no management
and then there is this:
Moreover, if the simplicity (and limitations) of LocalDB fit the needs of the target application environment, developers can continue using it in production, as LocalDB makes a pretty good embedded database too
"pretty good" implies that while it will work, there may be better solutions. Essentially, the lack of security is a feature of LocalDB. It is designed to run as the currently logged in user, giving them full access.
If you need Database Security as a feature of your deployed application, but do not want to deal with the complexities of a full SQL installation, you should consider SQL Compact Edition.
See this article How to: Deploy a SQL Server Compact 4.0 Database with an Application. Deployment will vary depending on the deployment methods used by the rest of your application.
Entity Framework is an abstraction layer which is not specifically tied to a specific database technology. It will work identically with LocalDb, SQL Compact, SQL Express, MySQL, postgresql, etc... usually with nothing more than than the correct database driver and the correct connection string supplied.

Choosing between SQL Server Express and SQL Lite

I have a project requirement to choose a light database for the application.
It's required to choose between SQL Server Express Edition or SQLLite. Which one would be efficient and reliable. I am supposed to run it under Windows 7/Windows 2008 R2. I am newbie in the database programming. It would be helpful if you can share some information in terms of
Reliability
Stability
Size Limits
Memory consumption
Performance
SQL Server Express and SQLite aren't really comparable database systems.
SQL Server Express is the free version of Microsofts full SQL Server product, a standalone database server (often run on a dedicated machine) that client applications connect to. It is designed for things like web applications where many users will be using the database at the same time and there is a requirement for high availability.
SQLite is a compact in-process database that is often used in applications that benefit from having access to a SQL based database system however it isn't feasible to install a full standalone database alongside the application. For example Firefox uses SQLite to store bookmarks and Adobe Lightroom uses it to store its photos catalog, there are also several mobile (e.g. iPhone) applications that use SQLite.
The Microsoft equivalent to SQLite would be SQL Server compact edition (CE) which is free to distribute and use. SQL Server CE is very similar to SQLite in most respects.
Similarly the non-Micrososft equivalent of SQL Server (both the Express edition and the full edition) would probably be MySQL.
Although there are crossovers (you might build a small web application that uses SQLite, or a large desktop application that requires users to install SQL Express) typically the choice between the two "types" of database system (in-process vs standalone database server) is down to the type of application being developed.
You might find more details in the following article: http://erikej.blogspot.com/2011/01/comparison-of-sql-server-compact-4-and.html

What to consider when getting started with SQL Server?

I've got experience with MySQL, DB2, and Oracle, but aside from writing a few queries, I've never used SQL Server.
My question is a three parter:
1) For a developer, what are some good "free" client tools to look at, and why (by "free" I mean open source, freeware, or the tools that come with SQL Server itself)?
2) I plan to run Developer or Express Edition on my workstation for development, and either Standard or Enterprise Edition in the testing and production environments. What methods exist if any for transferring data between different servers and the different editions?
3) Are there any common pitfalls that someone like me (who is used to the other database systems that I mentioned) might encountered during development?
TIA
SQL Server Express with tools.
All editions have the same SQL language features and code is 100% portable between them. There are 3rd party tools to synch changes, but moving entire DBs is easy using inbuilt tools.
Nah. The problem with databases is SQL and set theory, not the choice of RDBMS. If you understand databases/SQL you'll be OK.
SQL Server Management Studio which comes with SQL Server (any editions), or you can download it separately. SQL Server Profiler which doesn't come with Express.
Management studio has tools for backup/restore database. You can also consider detach/attach method to synchronize db .
It's hard to say. But if you had Mysql experience you will be pleasantly surprised by SQL Server.
UPDATE
There are so many things that each DB vendor implements differently that it's really hard to focus on some of them. One thing I was not used before is that SQL Server doesn't let unique columns to have more than 1 NULL value(there is a workaround though)

Resources