I've decided to develop VB.net Application With SQL server Express 2008, but Microsoft says:
They limit 4 GB Size per DB!
So I'm developing my app for Single user Desktop pc, so what should I do when the DB reached the Maximum size?
When the DB size reached to maximum size, is it a good thing to create a new DB and allow my vb.net application to work with both DBs?
in regards to the 4GB limit of your free version of SQL Server, your options as I see them:
1) purge old data as it becomes unnecessary
2) hack application to use multiple databases (would this even work on a single pc?)
3) hack your application to move items to data files as necessary and out of the DB
4) pay for the proper version of SQL Server
5) go to MySql or something similar
SQL Server 2008 R2 Express size limit was increased to 10 GB, so if your just starting a new project you should use 2008 R2.
Nothing wrong to attempt for free tools. I suggest that you redesign your application to use multiple databases.
1) Create a new table for storing multiple databases setting data
2) Things to store in that table include: total databases, connection string for each database, and so on.
Consider storing each table in a separate database (where appropriate)
If you expect to exceed 4GB (are you sure?) then some options might include...
archive older data into a separate database
don't use sql-server express -- use a standard version that can grow.
Related
I have a website with not more than 100 products which shall grow to 1000-5000 over the period of time if the website grows.
I like SQL CE as its hassle free in deployment and backup. The only thing i am afraid is the performance i will receive from it. My website has 5 tables in the db and i am using entity framework, so a lot of querying goes in and out.
Should i go with the SQL server at the very start or a SQL CE is decent enough in performance for a small to medium ranged website.
I would certainly go for SQL Server. If you have a small budget I would recommend the Express version if you don't do anything fancy : http://www.microsoft.com/en-us/sqlserver/editions/2012-editions/express.aspx
We use SQL Express for our development environment with more than 20 tables and almost 100000k rows and we never had any performance issue !
If SQL Express is not available, I would still pick SQL Server since no new version of SQL CE is planned and it does not support stored procedures, XML data types, ODBC. Also, SQL CE is optimized for an architecture where all applications share the same memory pool, wich is not the case here with a small website database.
What are the maximum number of tables that you can have in:
SQL CE4
SQL 2008 R2 Express
Numbers here http://msdn.microsoft.com/en-us/library/ms143432.aspx I guess is for SQL Server 2008, but are they valid for Express and what about SQL CE4?
The sum of the number of all objects in a database cannot exceed 2,147,483,647
BTW. Sorry for duplicating questions, but it seems to me Stackoverflow is providing answers more quickly.
No word about CE, but Express is normal SQL Server + database size and memory / processr limitations.... If you can fit yoru tables into the size, the normal SQL Server limity apply.
SQL Server Compact 3.5 limitations here:
http://msdn.microsoft.com/en-us/library/ms172451%28v=SQL.105%29.aspx but that only points out 1024 columns per table and no specific table limitation.
SQL Server Express is the same as normal SQL Server as TomTom points out, it's just limited by memory, processor and database size, the limits of SQL Server Express edition are:
Constrained to a single CPU
1GB RAM
10GB database size (4GB in versions before SQL 2008 R2 Express)
Otherwise express edition is standard, this is to allow databases to be moved to and from SQL Server Standard to SQL Server Express, which helps in system development. So for SQL Express it's still The sum of the number of all objects in a database cannot exceed 2,147,483,647
As I said in a comment, if you're doing anything that gets close to hitting these numbers you should really look at your DB design process, if they're being automatically generated then consider not partitioning into so many tables.
By this I mean that you should be selecting your SQL Server version based on other requirements, if suppose SQL CE is limited to 256 tables (not saying that it does since I can find no such thing, and it's much more likely to be at least past 1024), and say you need 500 tables. Then either look at denormalizing some of your tables, or at that point you really need to upgrade to including SQL Express with your program (this just complicates your software deployment process, and not a lot more).
I don't have SQL CE avail atm, but the easiest way would be to just have a test go run off and generate 10k create table statements, with each table having 20+ columns. If your requirements are greater than that then just use numbers that you know.
Lastly, there's SQLite which you haven't asked about, again there's no documentation on this but I suspect it's likely 64k+ you're limited to only 64 tables in a join though.
For SQLCe4, I got the response:
There is no limit on number of tables, but we do have a limit of 4GB
file size.
A colleague I work with recently told me that SQL Express and MS Access were essentially the same thing; that does not seem to be an accurate statement. I know you can convert Access to a SQL DB and maybe under the covers they are similar, but I would assume that the SQL DB engine and what is used to run access are not the same. Not only that, but the SQL statement syntax, etc. I know are not the same.
I am mainly trying to understand so that I am more informed about the versions.
Um, no, not the same.
First off, I need to clear up some terminology. MS Access is a Rapid Application Development (RAD) tool that allows you to quickly build forms and reports that are bound to relational data. It comes with a file-based database engine (Jet/ACE).
Access the RAD tool can be used with many different backend databases (Jet, SQL Server, any db that supports ODBC, etc). I have to assume your colleague was specifically commenting on Jet/ACE, ie the database engine that MS Access uses.
I think the single biggest difference between the Jet/ACE database engine and MS SQL Server Express is that Jet/ACE is file-based and SQL Server Express uses a client/server model. This means that SQL Server Express requires a running service to provide access to the datastore. This can complicate deployment in some scenarios.
SQL Server Express is really just a throttled-back version of SQL Server: max database size of 4GB (10GB in 2008R2), only uses a single physical CPU, etc. These limitations are imposed to prevent large organizations from using the freely available Express edition in place of a full-blown SQL Server install. The upshot to this is that SQL Server Express offers a truly seamless upgrade path to SQL Server. It is also (generally speaking) a more robust and fully featured database management system then Jet/ACE.
Similarities
relational database management systems
written by Microsoft
Differences
MS Access
File based
free distributable runtime (2007 or later)
RAD tools (form/report designer)
uses Jet SQL
max file size 2GB
SQL Server Express
Client/Server model
free
no RAD tools
uses Transact-SQL
max database size 4GB (10GB for SSE R2), max one physical CPU
I think what your colleague had in mind was SQL Server CE, which is a super-lightweight embedded database, which is still (IMO) far superior to Access in database-management aspect. SQL Express cannot even be compared with Access without offending the former.
Here are the datasheets for both products so you can see some hard facts on the difference between the two databases.
Access:
http://office.microsoft.com/en-us/access-help/access-specifications-HP005186808.aspx
SQL (Express is listed on the far right column):
http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx
The comment I have always read is that Access is great for single user single access database use, the minute you scale beyond a single user look elsewhere. While that may be a "bit" of a stretch, Access really does not do well in a multi-user environment. From experience we've had a client who has ignored and ignored our requests to migrate a backend database from Access to SQL, and there have been numerous occasions where we have had to restore from backups, or take the Access database offline due to corruption.
They are two completely different technologies with two different target markets. The database engines are indeed different, as you mention T-SQL is different than Access SQL.
You can "scale up" an Access database to SQL by creating an SSIS package or other tool to do the import, but this takes the Access schema and data and migrates it to a true SQL database. It does more than just attach the Access database or the like.
Anytime you need a "real" database I'd highly recommend looking at any of the SQL versions that are available over Access.
Just remember that with MS-Access you don't have size limitations if you play your cards right. There is no reason, for example, not to have many 2 to 4 Gig tables each contained singularly in their own database. Your ODBC applications can open a connection to multiple MS-Access databases and query the single table in each. So you can have a database containing trillions of records, stored in multiple MDB files. One company I went to work for was using a single MS-Access database to run a issue tracking system done in MS-Access forms. They could only use it one person at a time because of sharing issues that would lock MS-Access up. I wrote a Win32 Perl native Windows GUI user-interface to the database that was better at field/record validation, and my ODBC code was able to manage the connection for simultaneous user access. I managed the opening and reading and writing and closing of the database for each user through my Perl program. I did not leave the database open. I did not maintain a persistent connection for each user, but instead only maintained a connection long enough to retrieve a record for edit. Then I closed the connection until it was time to write the record back to the database. Also, I wrote my own record locking program logic by maintaining a user login table that contained the record id of the record a user was currently editing, then erased that entry when no longer editing that record. When another user went to edit the same record, the program checked if that record was currently open for edit by another user. The system worked flawlessly. MS-Access never locked up via ODBC and multi-user access. I even embedded the password to the database in my compiled Perl program so that no one could get to the data in the Access database other than through my Perl program.
We ported a database server from SQLServer 2005 to SQLServer 2008 (SP1). The new server has more Processors (4 Quadcore versus 1 Quadcore ) and more memory (4GB versus 64GB).
Processors are 2.1Ghz(new) versus 2.0Ghz(old).
The new OS is Windows Server 2008 and the old is Windows Server 2003.
The databases were transfered via backup/restore and run in native SQL Server 2008 mode (not in SQLServer 2005 compatability mode ).
Some queries on the new server run slower than before. These queries use indexed views. The queryplan looks the same on both systems.
Most of the queries perform equal.
My task is now to decide if we have a problem with our SQLServer installation, if the we have a problem with the database or if this is an expexted result.
I first want to compare performance of both
Sytems
SQLServer installations.
Is there an easy way to do this?
Has anybody had comparabele results on new SQLServer installations?
Before you check your hardware/OS, make sure you:
update statistics
rebuild all indexes
and then run your tests again. Also, are the editions of SQL Server identical? There are differences in how you have to write queries against indexed views based on the edition (Standard vs. Enterprise) of SQL Server.
Also, confirm that your indexed views are still indexed properly by selecting 1 row from them and observing the query plan. You should see only one table in the resulting plan.
The easiest way to collect performance of both systems is to run a PAL, and collect the approriate data.
PAL has extra counter sets for SQL Server. It will collect and analyse the data, and let you know where you have an issue.
PAL can be found here
http://www.codeplex.com/PAL
Also an important issu is to location of the filegroups. How is the underlying storrage system defined? It usually has a huge impact on the SQL Server. (You should talk about spindels here, and not raw size...) Make sure your database files are not sharing the resources with anyone else
What is the difference between using SQL Express .mdf file and an actual SQL Server DB? Why wouldn't I use .mdf file for everything? Is there a size or performance limitation that would prompt me to use SQL Server DB? I currently use actual SQL Server DB's for every project I work on so I am just curious to know if an .mdf file might be more cost-effective.
SQL Express runs only one scheduler, so can use basically only one processor. It imposes a hard limit of 4GB on database size. It won't use more than 1 GB of RAM. And many features are license restricted, like certain replication scenarios. See here a full comparisson.
SQL Server Express has features deliberately removed to make it less useful. For instance, databases are limited to 4 GB in size, and it can only use 1 GB of RAM. I recommend you look into FOSS databases like PostgreSQL and MySQL, which don't limit you like this.