Project using two different versions of SQL Server - sql

I am a junior developer and about to get my feet wet in my first "real" project. However we are trying to figure out a way to set everything up as the current developer lives out of country.
I was told to install certain programs, subversion clients and SQL Server 2000.
It does not seem that SQL Server 2000 can be installed on Windows 7. Are there inherent issues with me developing in a higher version of SQL Server like 2005? Is there an issue with stored procedures that can not be properly translated from on SQL Server version to another?
Again, I'm fairly new at this; please let me know if this is just a bad idea, impossible and any other guidance you can provide.

There are many features in newer versions of MSSQL that were not there in 2000 (multi-row inserts, newer hashing algorithms, and VARCHAR(MAX) to name a few). If you're using SQL Server Management Studio, it will not check these differences for you, even if you are connected to a SQL server 2000 database - it automatically uses 2008 rules for its syntax highlighting. Because of this it's easy to accidentally write code that's not 2000-compatible.
As far as getting 2000 running, if you have the install disk for an older version of windows, you could run a VM (http://www.microsoft.com/windows/virtual-pc/) and install the database server there. If your company has a separate development environment, you could create a copy of the production database to work off of as well.

The newer versions of SQL server bring new language and database features, if you write something using a feature that is available in SQL 2005 and not 2000 i.e. PIVOT then when you try and promote this to live then it will just get a syntax error.
There is no translation, if you went back in time 11 years, you'd still speak English you'd just get an odd look if you talked about 'Tweeting'.
You can set the database compatibility level to an earlier version for the specific database you are working on. This will stop you using the more modern features.

For the most part, you won't run into issues is you're simply running standard stored procedures and SQL statements.
However, there are several things that might not work properly if you're not in sync. SQL2005 was a relatively major upgrade and instroduced quite a bit of new functionality.
I don't know what you've got for available resources - dollars, etc, but if you have an MSDN Subscription at a level that provides you access to operating systems, then I would strongly recommend setting up a virual machine with an older version of Windows using your MSDN licenses, just to keep things on an even playing field.

Related

What's the best version neutral method for deploying a SQL Server database?

On my development box, I always run the latest version of SQL Server. I often deploy databases from my dev box to a live/staging area for review or testing. I've done this many times and it has always been a painful process, but I am realizing that I need to find an easier, more reliable and consistent way of performing this basic operation.
I normally use WebMatrix purely for deployment and it's worked fine, but I've been having problems getting it to work on my server for some reason. Consequently, I am seeking an alternative solution.
Creating a SQL dump file would probably work, but it's not an acceptable solution a database contains images and easily exceeds 2 gigs of data which would take forever.
The Import/Export utility fails due to issues with incomplete schema copies, identity inserts and checks. The solutions offered for these issues has failed to work in my particular case.
The Backup and Restore method also fails due to some strange incompatibilities between SQL Server 2008 and 2012. SQL Server 2008 Management Studio throws exceptions during the restore process of a 2012 database. It's odd that this happens, even though I set the compatibility of the database to version 2008.
I haven't tried the Detaching, copying and reattaching files method, but I haven't bothered trying since it would probably fail for the same reasons the backup and restore method did.
Are there other alternatives out there? Also, why is this so unbelievable hard for a task that is so common and important, especially in this day in age of 2013? Get real Microsoft!
We changed our method of deploying and moving databases between servers, instances and versions by adopting the tools from RedGate. They are expensive, but worth it IMHO.
My team creates scripts for ~everything.
Database Creation, Alter, Inserts, etc, etc.
And we write all scripts that check for the existence of things before trying to create them.
Aka, we can run the scripts over and over and get the same results.
And we deploy to different environments by using SqlCmd.exe.
EDIT
See:
http://odetocode.com/blogs/scott/archive/2008/02/02/versioning-databases-views-stored-procedures-and-the-like.aspx
and
http://odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for-database-work.aspx
=============
If that is "too much" then I agree with the other poster, RedGate is your friend.
Points below aside, have you considered the Database Projects within VS2012? they allow you to script off the tables, sp's, triggers, users etc you want, generate sql cmd scripts, make changes and schema compare and version control your database code, I'd certainly recommend it
"Creating a SQL dump file would probably work, but it's not an
acceptable solution a database contains images and easily exceeds 2
gigs of data which would take forever."
Why is this a problem? where are you transferring the file from and to and over what connection?
"The Backup and Restore method also fails due to some strange
incompatibilities between SQL 2008 and 2012. SQL 2008 Management
Studio throws exceptions during the restore process of a 2012
database. It's odd that this happens, even though I set the
compatibility of the database to version 2008"
This shouldn't be an issue if file is created in 2008 prior to restoring. If you create a new DB in your 2008 instance, then take a backup from that and restore it to a 2012 instance with 2008 compatiblity, then you should be able to use it there, back it up from the 2012 instance and restore to 2008 again afterwards.

How can I make a SQL database, and use it in VB2010 (having more than 1 computer accessing the database)

The background to my problem is based on distributed computing. I want to have a database with some numbers in them and then a number of computers go through each row calculating another number (a little bit of an over simplification).
The problems I'm having are routed in my poor understanding of SQL servers (I think). I've got Microsoft SQL server 2012 (and 2008) installed on this machine and I've somehow managed to make a server for this task but then the problems arise.
I can't add a table to the server (I'm trying to do this in VS2010). When I expand the server and right click on tables and select add new table i get the following error:
"The server version is not supported. Only servers up to Microsoft SQL Server 2008 are supported."
That stops me making a table and from there I can't move on. I've downloaded and installed the VS2010 SP1 (and re-installed it again when it didn't fix the problem) as I found this suggested for similar issues.
Any help on this would be greatly appreciated. I've read around but nothing seems to work, people suggest using "SQL Management Studio" but I don't seem to have this installed!
Also, I haven't gotten to this step yet, but if this gets fixed any advice/links on how to access the database from a different machine (over the same local network) would be greatly appreciated!
Many thanks,
Fraser
R Harvey gave you the pointer to SSMS - that's the ideal tool to use.
As for other computers accessing your local database - the name of your computer (where MSSQL is installed) is the name of the server in your connection string.

Starting From Scratch - What SQL database should I use with Visual Studio?

I recently got a new primary computer. On my old one, I was working with MS Visual Studio 2008 (or maybe an older version - I can't remember now). I had managed to get SQLite working with it and was in the start/middle of building an application.
On the new computer, I now have MS Visual Studio 2010. I have had problems getting SQLite to work with it. Honestly, I haven't tried super hard yet, because I realized I pretty much want to completely redesign this application anyway and it got me thinking... do I really want to use SQLite or some other SQL? MS SQL (or is it called SQL Server)? MySQL?
My end goal is to have an application that can be installed by the user with one .msi file and the user should not have direct access to the database (although at this stage, that is a secondary concern).
It seems like MS SQL / SQL Server is the easiest since it's also an MS product.... Would love some opinions!
(along with the opinions, I'd also love to be pointed to current instructions... I'm a programmer, I'm not a "coding environment setup" person and have always struggled with this. All I want is to get in there and write my application!)
Thanks in advance!
-Adeena
PS... I'm currently working with C# and would prefer to stick with it, but could easily do this in C++ (I'm fluent in all the flavors of C) if that makes a difference with the database.
SQL Server would be a good choice by the sounds of what you're after. Try the express version - it's free, good for development and prototyping and integrates really well with Visual Studio.
The SQL Server Management Studio tool is excellent. I use this to create the databases I need and then use Visual Studio to manage them (saves switching windows and running both applications when you're working in VS all day anyway). I used to have my issues with the old Enterprise manager software but things really seems to have stepped up for SQL Server 2008 and the new management studio.
Like the title of your question suggests, you're wanting to use this with Visual Studio. If you decide to do use SQL Server then you should:
Download the express edition
Download SQL Server management studio
Create a database
In Visual Studio - click View -> Server explorer -> right click Data connections and add connection. Select MS SQL Express and choose localhost as your server. You can then select the database you created using the management studio.
There you have it - integration with VS.
You say you're using C#.Net - well SQL server and .Net go hand-in-hand. Obviously you can hook up to other third party databases but SQL was really made to work with this stuff. It's a powerful database engine and will do everything you'll ever need as well as being well supported by Microsoft and the wider community.
If your final goal is to have hands-off single-click installation then I don't think SQL Server Express is your best bet because it's not a file-based embedded database. It's a great db and very easy to work with, but when it comes to deployment still takes some installation effort. You could try one of: SQL Server Compact Edition, SQLite or Firebird Embedded.
SQLExpress is free and for development purposes is pretty much interchangeable with the full SQLServer
http://www.microsoft.com/express/Database/
SQL SERVER seems to be the logical one.

SQL Server 2008 express performance in production environment?

I am about to move servers and i was talking to somebody and they suggested using sql server express 2008 installed on the servers. I have full access to the server.
Does this express engine work at the same speed (performance) as a true sql server 2008?
I know about the limitations i..e max 4 GB per DB ... and max 1 GB of ram... Considering the server has 2GB installed and is shared with windows... i don't see this being a problem but would love to hear some feedback..
I have around 4 dbs .. and they have maybe 4 users logged into them at the same time, its not a great deal of use really...
What i really trying to mesure up is if i should installed SQL SERVER 2008 FULL version on the server or express..
Any help with a choice would be really helpful.
It appears express uses the same DB engine as the FULL version ...
I don't need any clever replication, clustering or things like that...
But i want to go down the right path ...
Any help really appreciated
Express is the same code as the other SQL editions (Workgroup, Standard, Enterprise/Developer and Data Center). The only different code base is the 'CE' edition, that is based on the mobile SQL CE code. Express has the restrictions you already enumerated (DB size, RAM) and also is using only one scheduler, so in effect will use only one CPU core. Also certain features are restricted in Express, like certain replication scenarios. The biggest advantage is that customers can start with Express and if they out-grow its capabilities they can swap in a higher edition without any application change, the database files are interchangeable between all editions, including Express.
Its the same engine, but I found you have to fight it all the way in making it anything but a desktop-environment database, from management to tcpip configuration, etc. And of course, it has built in limits on database size and resource usage. Once it is configured the way you want though, it runs fine. In real production settings I find the lack of SSIS quite the killer, though.
So the bottom line is that it is usable, but not great. You might also consider the Workgroup edition, which is reasonably priced and less limited, but of course it is more expensive than free.
Just to add to this SQL Express 2008 R2 can use multiple cores (but only 1 CPU).
You'll probably be fine with Express. It's the same basic engine. If you ever want to upgrade, the process should be rather painless.
you should be fine, performance should be similar to full version in your case since your databases are small

Access vs SqlServer for a Simple Database

I am currently developing a very simple database that tracks people and the company certifications they hold. This db will need to store letters of certification as PDF files. I was asked to develop this in MS Access, but I think it would be better to build it in SQLServer and use Windows Forms to build the interface. This app will need to be accessible from a public location like a share drive.
My question is, would it be better to do this in SQLServer like I think, or am I full of it and my boss is right on the money? Or are we both wrong?
A good alternative to Access which I use a lot is SQL Server Compact (SqlCe). This is a completely different product than SQL Server Express/Standard/etc. It is an in-process database like Access, it does not run as a separate process or service.
It is free
Full ACID support
Supports multiple connections
Full transactional support
Referential integrity (including cascading updates and deletes)
Locking
T-SQL syntax and SQL Server data types (same API as SQL Server)
Small footprint (~2 MB)
Easy deployment (supports ClickOnce, MSI, XCopy, etc)
Database is contained in a single file you can move around
Supports ADO.NET, LINQ to SQL, LINQ to Entities.
This is an extremely difficult question, without an understanding of the scale of the application. In my opinion, I wouldn't touch Access with a 33.5 ft pole.
Benefits of Access:
No dedicated machine necessary
No problems with portability
Benefits of SQL Server
Better SQL compliance
Better management control
Are you planning to store PDF files in the DB? If so, why?
I choose SQL Server.
An application built on SQL Server will be more robust and support more users than one built on MS Access.
An application built on MS Access can be easier to debug because there is a lack of a server, lack of significant multi-user support, and the entire database sits in a single file on disk that is easily copied around.
Given that, in almost every case, I choose SQL Server over MS Access.
Argh, do the world a favour & use SQL server. Express editions are free, and plenty powerfull enough for your requirements. You can even continue to do the form/report/UI design in Access if you so desire, it can hook up to SQL Server very easily and transparently.
Pros of SQL over access: concurrency, scalablity, reliabiliy, less future developers trying to hunt you down and kill you.
I would almost never use access for a db if I could avoid it, now that SQL Express exists.
If I were you I'd go with what some of the others said and use SQL Express:
http://www.microsoft.com/express/sql/default.aspx
You get all the benefits of a true SQL environment FOR FREE! You can even use the SQL Management Studio as well as leverage Reporting Services (if you download the advanced pack). Download link below:
http://www.microsoft.com/express/sql/download/
Which edition of SQL Server 2008 Express is right for you?
SQL Server 2008 Express is available in the following 3 editions (each is available from the Install Wizard):
SQL Server 2008 Express with Tools
SQL Server database engine - create, store, update and retrieve your data
SQL Server Management Studio Basic - visual database management tool for creating, editing and managing databases
SQL Server 2008 Express with Advanced Services
SQL Server database engine - create, store, update and retrieve your data
SQL Server Management Studio Basic - visual database management tool for creating, editing and managing databases
Full-text Search - powerful, high-speed engine for searching text-intensive data
Reporting Services - integrated report creation and design environment to create reports
SQL Server 2008 Express (Runtime Only)
SQL Server database engine - create, store, update and retrieve your data
SQL Server 2008 Management Studio Express (SSMSE)
Free, easy-to-use graphical management tool for configuring, managing, and administering SQL Server 2008 Express. It can also manage multiple instances of the SQL Server Database Engine created by any edition of SQL Server 2008 including Workgroup, Web, Standard and Enterprise.
Note: This separate download is designed for customers who have previously installed SQL Server 2008 Express (Runtime Only). If you are looking to download SQL Server Express and SSMSE for the first time, please download the SQL Server 2008 Express with Tools from the Install Wizard.
Access, to me, is really a hobbyist tool or for REALLY basic local projects at this point that just hasn't been phased out yet. I'd definitely look to using SQL Express, plus it makes it that much easier to upgrade if you get beyond the 4 GB database barrier in the future.
Go with what you have the best skills in - Access is great for a variety of projects andit can scale really well if you know what you're doing. Conversely, a bad programmer could do an app in Win Forms and SQL Server and produce a badly performing monster.
I personally would go with SQL Express and a Win Forms or ASP.Net front-end as experience shows that these small projects can easily develop over time in to much bigger applications than was originally planned and a well structured database built on SQL Server can scale up more readily to more users if needed.
Hard to say without understand the environment. It could be that all users have Access, but no desktops have .NET Framework (although this would be hard to believe). Maybe all their applications are on Access and that's all the developers and users there know.
Given all that nonsense tho, You ought to use SQL Server Express 2008 and Visual Studio 2008 Express. Hope I don't get you fired. :)
If the application is, as you said, a very simple database, that's what access is precisely for, creating simple databases. You can write both the database and the application forms within the same environment and users won't need to get anything installed.
Be careful though with concurrent access to your application. If you go for the access solution, multiple users won't be able to use the application at the same time. If you want this to happen, you will need the database and the application being apart. This doesn't mean that the DB needs to be SQL server, you can still use Access as your database if you don't require the power of a more complex engine.
EDIT: Just read on a comment that you are planning to have 10 users and less than 1000 records. FORGET about SQL server, you will be wasting your money. No matter if you decide to go for a simple all-access solution or for a distributed web application or desktop app with remote storage, Access is hundreds of times more powerful that what you need. Even for the "toy-ish" engine that access is, you are not using a 1% of it.