This seems a bit strange. I migrated a database in a test environment from one server (SqlExpress) to another (full SqlServer). I did that by detaching the database from the first server, copying over the mdf- and ldf-file and then attaching those to the new server. That worked well, except I see some performance losses, hence I want to do some comparisons in terms of speed and maybe exection plans and here starts my problem:
I cannot reattach the original database I left on the old server (SQLExpress), I did not do anything to it since it was detached and it worked like a charm until I did.
But now, when I want to attach it to the original database server (Sql Express) I get this message:
CREATE DATABASE or ALTER DATABASE failed because the resulting cumulative database size would exceed your licensed limit of 10240 MB per database. (.Net SqlClient Data Provider)
Sad thing is, this is party true, the database is 10,911,616 KB in size (1,024 KB for logs), which, honestly, stumps me, since I didn't do anything with it after detaching and it worked up until then.
However I am very certain, there is lots of free space inside that database (something around 9GB)
So this is a three-part-question:
- Can someone point me to the circumstances that could lead to this problem (database working on the very same server, then detached, not changed (at least by me), then not being able to re-attach?
- Is there a way to free up space inside that mdf-file without actually attaching it?
- Or could it be feasible to take the database I already attached to the new (full) SqlServer, shrink that in size and then attach it to SQLExpress? (or would attaching to full SqlServer change the format of said mdf-file to be unusable by SqlExpress?)
additional Server information:
- New Database Server has version Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)
- Old Database Server has version Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64)
- Database is running in compability level SQL Server 2008 (100)