Attaching databases of sql 2000 - sql

I have few databses of sql 2000 on windows 2000. Can I attach these databases to another instance of SQL Server 2000 on anothermachine having windows 2003 installed?? Does attach and detach of databases are platform independent??

You should be able to attach and detach databases of the same SQL Server version across different Windows OSes.

I believe you can detach and re-attach from the same SQL version; however this can cause issues so it would be best if you backed up the database from the original server, create a new database on the new server of the same name and then restore it into it.
Windows version shouldn't make a difference.

Related

No UI dialogs in MS Azure / SQL Server Management Studio

Recently, I purchased a licence for a Microsoft Azure SQL Server 2012 (packet "S0" - Standard, 250 GB)
When I connect with SQL Server Management Studio 2012 to this database, then all the user interface dialogs for creating tables, setting up users, etc. are gone.
You can only script and execute pure SQL statements.
Even the table editor is gone, so you even cannot edit the data in a table!
If I connect to a local database, then everything works. So the problem must be related to the Azure Database. Can anyone help ?
If this is Azure SQL Database, then keep in mind that this is not the same as SQL Server 2012 although you can use the same tools to connect to it. This behavior is therefore correct and normal. If you have installed or used an image for SQL Server on a VM then you should have everything as you expect.

Conversion from LocalDB (.mdf) file to SQL Server Express .mdf file and reverse process

Since we need to move around our database a lot (like update it with new Rows which are generated by code and then update it prod db and reverse process). SQL Server CE, being a file based system was very helpful.
We would like to upgrade to use SQL Server Local Db but at the same time, it has limitations of use with IIS (though possible with AttacheDbFile). In this regard, since LocalDb is more or less a version of SQL Server Express, would it be possible to use our SQL Server LocalDB .mdf in our development environment and then copy them in prod but use by attaching to a SQL Server Express instance?
If yes, what additional thing, we need to do make it possible?
Also, we would like the reverse process to be worked out as well, mean detach the .mdf file and use it as LocalDb in development environment. I have read the great blog articles of
Krzysztof Kozielczyk also but not have experimented much with LocalDb.
LocalDB IS SQL Server Express (introduced with SQL Server 2012 Express), and the .mdf file is identical between LocalDB and SQL Server Express (and even a "full" SQL Server edition like Web, Standard or Enterprise Edition).
The only caveat is: you need to be using the same versions of those databases, since the file format is only identical amongst same versions, and can only be used amongst the same versions (e.g. 2012) - or it can be "upgraded" to the next newer version (e.g. you could move a database from LocalDB 2012 to a SQL Server 2014 Express once it's released) - but you can never go back down to an earlier version (you cannot take a LocalDB 2012 .mdf database file and attach it to a SQL Server 2008 version).

SQL Server - Sharing database over different boots on local machine

Suppose I have 2 bootable partitions on my local machine with Windows 7 running SQL Server 2008 R2 on one and Windows 8 with SQL Server 2012 on the other.
Is it possible to run/attach the same database (created under SQL Server 2008 R2) on both versions of Windows so if I boot up Windows 7 I can run my application against it. And if I run up Windows 8 I can run my application up against that? Would there be any issues if I tried it - i.e logins?
Thanks,
Andez
No, that won't work.
As soon as your SQL Server 2012 version would access one of the database, it will upgrade it to the latest internal database version for the 2012 version.
And once that's happened, the SQL Server 2008 R2 cannot use that database file anymore.
The best solution for this would be to put the database on a separate server which you can access from both your partitions - and consolidate on one SQL Server version (preferably 2012). The other obvious option would be to install the same version of SQL Server on both partitions.
Everything is stored within database, so no you will not have any issues. Just remember to use not only main application database, but use the same meta-databases (aka System dbs).
In fact it works this way on failover clusters.
EDIT:
Haven't noticed you are going to run 2 different db systems. I would recommend you to use exactly the same versions of SQL server.

SQL Server 2005 and SQL Server 2008 Coexisting in Windows 7 machine

Some SQL Server 2005 and 2008 questions.
1) Can they coexist on the same Windows 7 machine without issues?
2) Can you attach and run 2005 databases to SQL Server 2008 without compatibility issues or is this a no go?
3) Does SQL Server 2005 even work on Windows 7?
Yes, both can coexist on the same machine without issues.
Yes, however, once you attach a 2005 database into a 2008 instance, you have upgraded it to 2008 never to go back to 2005 unless you export the data into some universal format. You can however, have both engines running simultaneously and can use either set of management tools to see either database (although some features will only work with the 2008 management studio working against the 2008 database)
Yes. Both sets of tools (including Management Studio) and services can coexist on the same machine (I have this very setup). The only thing you cannot do is to have both engines listening on the same port. Thus, one of the two will have to be a named instance.
1) Yes.
2) You can view 2005 database under 2008 management studio, not sure about hosting them under a 2008 instance though. I'm fairly confident they do, but not sure if it's native or via converting to a 2008 database.
3) Yes.
Note that you can't have 2005 MS and 2008 MS (management studio) installed on the same OS. This was based on my experience a long while ago when 2008 first came out, I got an error message stating that I couldn't install it because of a previous version (2005) being installed, or something akin to that. Turns out it has changed.

Importing Sql Server 2005 database into Sql Server express 2008

Is there any way to import a database backup from 2005 into 2008 express edition. What I've had to resort to is doing a script the database, then import all the data through DTS. Whenever I tried to import straight from a backup file it says something about not being to import into a new version of sql server or I'll get the below error.
title: Microsoft SQL Server Management Studio
Specified cast is not valid. (SqlManagerUI)
SQL 2005 backups should be restored on 2008 without problem (have done that myself many times). What exact error message did you got about versions?
The other error (Specified cast is not valid) seems to be Management Studio error, not server error. Have you full rights on 2008 server?
Look at this question - any-reason-to-have-sql-server-2005-and-2008-installed-on-same-machine - there are talked both about restoring SQL2005 backups and about attaching SQL2005 data files.
(Of course you cannot attach production databases. To attach non-production databases just detach them, make file level copy of these and attach copies to new server. Orginal files need to attach to original server too :))
I imagine that you are in a development process where your data will have to be regularly copied to you SQL 2008 server.
You can then think of configuring a replication between the SQL 2005 server (publisher) and SQL Server Express 2008 (suscriber). Depending on your requirements, you have the choice between snapshot or merge replication. If no update is done on the suscriber side, go for snapshot.
Once you want to have your 2008 server running independantely from the publisher, just delete the replication.
A valid SQL Server 2005 Express backup file should be able to be restored to SQL Server 2008 Express. If the SQL Server 2005 backup is from the Standard or Enterprise versions, you might hit problems restoring it to Express. The user context that the backup was created from should not affect the ability to restore that backup.
One thing you can do is to try running the restore operation as a verification, without actually trying to run the restore. That will tell you if the backup file is valid or not. You can use this syntax:
RESTORE VERIFYONLY
FROM yourbackupfile.bak
If possible, I would also suggest trying to simply detach the original database from 2005 and then attaching the file at the 2008 edition.
While I have only tried this with the standard edition myself, it has worked perfectly with the compatibility mode keeping the database set to 2005.
Have you tried running the Upgrade Advisor http://www.microsoft.com/download/en/details.aspx?id=11455 - it might be able to highlight problems for upgrading the original database.