Copy database Task failing with "Transferring columns of data type 'sql_variant' is not supported"

Sudz28 186 Reputation points
2021-05-10T15:42:20.377+00:00

I have recently stood up a new Windows Server 2012 R2 server (VM) and installed SQL Server 2008 R2, in order to 'take over' for an older server (Windows Server 2008 R2) currently running SQL Server 2008 R2.

My plan is to copy over all the production databases (26 of them) over to the new server/SQL instance using the Tasks -> Copy Database option because this will let me copy all databases at once through a single process vice doing a backup/restore, which I'd have to do on each and every database one at a time. After working through some early issues I have the copy largely working, except for 5 of the 26 databases which continue to fail. The error every one of them throw on the destination machine is "ERROR : errorCode=0 description=Transferring columns of data type "sql_variant" is not supported. helpFile= helpContext=0 idofInterfaceWithError={C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}".

Given that both instances of SQL Server are the same versions, I'm having a hard time figuring out why this error is being thrown and what the remedy to it might be. Normally I would assume it was related to the differences in the operating systems, but this seems to be an sql-specific issue. If the data type is in use in the production database, why would it be rejected by the new instance? In checking versioning, I DID notice that the prod machine is using MDAC 6.1.7601.17514 whereas the new machine is using 6.3.9600.17415, but I have no idea if this could be related to the issue. Nor do I have any idea why one is a higher version than another as I don't recall ever installing MDAC on its own so it must have come 'bundled' with something? The OS maybe?

Full disclosure, I am not a database admin by any stretch, just an IT generalist who's been given the task to move the production database to a newer version of Windows Server.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,690 questions
SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
494 questions
{count} votes

Accepted answer
  1. Erland Sommarskog 100.9K Reputation points MVP
    2021-05-10T21:48:19.887+00:00

    The first part is easy:

    SELECT 'BACKUP DATABASE ' + quotename(name) + '  TO DISK =  ' + quotename('C:\temp\' + name + '.bak', '''')
    FROM sys.databases 
    WHERE  database_id > 4
    

    If the databases are to be restored to the same locations on the new server, the RESTORE is just as easy. If you put the files in different folders, that's a little more work.

    In any case, you should not use the Copy Database Wizard, as you have learnt the hard way. (The error message is telling you that it does not support this data type.)


4 additional answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,086 Reputation points Microsoft Vendor
    2021-05-11T08:57:20.28+00:00

    Hi @Sudz28 ,

    >"ERROR : errorCode=0 description=Transferring columns of data type "sql_variant" is not supported.

    According to the error message, data type "sql_variant" is not supported in Copy Database Wizard.

    There are some limitations and restrictions in copy database wizard, such as it is not supported system database. refer to MS document Use the Copy Database Wizard to get more.

    Did you try to use backups/restores or detach/reattach to migrate SQL instance. Please refer to the blog A Faster Way to Migrate SQL Server Instances to get more information.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Erland Sommarskog 100.9K Reputation points MVP
    2021-05-13T21:21:31.267+00:00

    However, I am unsure of the process for stopping the current prod SQL instance and taking new, complete back up files of the databases. If I stop or Pause, I can no longer send commands to make the files. How does one keep the databases from ingesting new information while trying to get complete backup files for them?

    There are a couple of ways to skin that cat. One brutal way is do to:

    DENY CONNECT SQL TO public
    

    Now only sysadmin can log on to the server.

    You can also run ALTER DATABASE db SET READ_ONLY on all databases before you start your backups. You will need to run ALTER DATABASE db SET READ_WRITE on the other server after the RESTORE.

    A popular way is to set up log shipping, so that the downtime can be kept to a minimum, but if a few hours of downtime is not an issue to you, there is no need for that increased complexity.


  3. Sudz28 186 Reputation points
    2021-05-22T00:04:06.603+00:00

    This MS forum has got to be the single worst internet forum I've ever experiences with it's formatting and it's flakiness at letting you post, which seems completely random and arbitrary. I've been trying for three days to post a reply to @Erland Sommarskog but it just won't take, so I'll try this method of posting it as an Answer.

    So altering back to READ_WRITE will make the database behave as they did prior? There's only "READ ONLY" or "READ WRITE", nothing else I would need to double-check?
    So to sum up on how to do this entire operation:

    1. On original db server, set all 26 databases to READ_ONLY.
    2. On original server, execute the BACKUP DATABASE commands to create a .bak file on the local drive for all databases.
    3. Copy the 26 individual .bak files across the network to the same location on what will be the new DB server ('destination' server)
    4. On destination db server, execute the RESTORE DATABASE command for all 2 .bak files.
    5. On destination server, set all 26 databases to READ_WRITE
    6. Power down original server.
    7. Rename destination server to original server's name, re-ip destination server to the original server's IP address. Reboot destination server.
    8. Once destination server is back online, ensure Sharepoint/whatever is connecting to it and can query for data/write data.
    9. Done!
    0 comments No comments

  4. Erland Sommarskog 100.9K Reputation points MVP
    2021-05-22T09:28:24.28+00:00

    This MS forum has got to be the single worst internet forum I've ever experiences with it's formatting and it's flakiness at letting you post, which seems completely random and arbitrary.

    I take it that you never used the old forums - they were a lot worse in my opinion.

    I occasionally have problems with posting, but those problems tend to be temporary. But, yes, I don't like this division into Comments and Answers. I have the impression the idea is that Q&A should be like Stackoverflow, that is more of a answer repository than a discussion forum, but that is not how it works in practice. And in that context the limitation of 1000 characters for Comments becomes a nuisance..

    Anyway, I think your list looks fine. I have two remarks:

    1. In point 4, I assume that "2" is a typo for "26".
    2. For step 7, don't forget to run this on the destination server: EXEC sp_dropserver DESTINATIONNAME EXEC sp_addserver ORIGINNAME, local

    You need to do this, so that @@servername gets the correct value.

    Then again, it can't be a bad idea to turn off application services like Sharepoint. I haven't worked with Sharepoint, so I don't know it reacts when the database all of a sudden becomes readonly.