Even if you are using the newest version of SSMS, and SQL server 2008, that does not automaically upgrade any databases that you have attached to it. I can see SQL Server 2000 databases in SSMS for SQL Server 2008. Any database that is not upgraded cannot use SQL Server code from the newer version. If you are in compatibility mode, you may not be able to use all functionality of the newer version. I would suggest you connect to the database you want to use new features in and see what version the database is:
Select @@version
Note - do not upgrade the database to SQL Server 2008 unless the production databse has been upgraded or you will write code that can't be moved to production. Upgrading a database to a new version is delicate and time-consuming process requiring much testing. Many companies take years to upgrade to new versions as a result.
Well, if you're only concerned with how to get around this partitioning issue you have, and are sure you won't face performance issues after you move to a single partition, then you could try to collapse all of your partitions into 1, and there's lots of ways to do.
If you feel your system can handle it, you could dump all the data into another table and give it a max ID number to dump into. Then when the bulk of the data is copied into there, you could note the ID, find any new records that came in. If it's a huge amount of records, dump those new records in the new table as well. After the 2nd dump you should be almost caught up. At that point you do not allow new data to come in for a few seconds/minutes while you run pre-scripted out commands to:
-move the remaining data into the new table that doesn't have partitioning enabled after making sure the schemas match.
-rename the old table. Make sure you don't have blocking issues.
-rename the new table to the old table.
You might want to avoid adding indexes at the beginning, and do those at the very end.
If doing this on the live system isn't an option, you could move the data to another system and do all these steps there.
Perhaps you could use this opportunity to archive your old data. You could consider creating a view and have your old data in a different archive read only database and have it referenced with a view.
How much data is it anyways, with and without indexes?
Best Answer
I've done this with a linked server (though on a smaller scale) so here's what I did:
sp_tables_ex
and this SO postSELECT * INTO db.schema.@TABLE_NAME FROM OPENQUERY('LINKEDSERVER', 'SELECT * FROM @TABLE_NAME'
where@TABLE_NAME
is retrieved from the info captured in step 2.I tried doing this with SSIS but couldn't get the components to play nicely. Again, this is just a rough sketch of what I did. If you'd like more details just ask in a comment and I'd be happy to give them.
EDIT (I just added the code anyway):