Handling Error 40619 while copying database using T-SQL

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.

We got an error while copying a database from one server to another server or the same server using T-SQL command:

create database testcopy2 as copy of testcopy(Service_Objective='S2')

 

Msg 40619, Level 16, State 1, Line 1

The edition 'Standard' does not support the database data max size '3221225472'.

 

Steps to reproduce this error:

1. Create the source db with Maxsize=3GB/4GB with any SLO(Vcore or DTU). Here I am using General Purpose 2 vcore as an example.

 

Akshay_Manjeshwar_1-1677687815848.png

 

2. From SSMS try to create a new db(target db) as copy of testcopy with (Service_Objective='S2') or any other SLO in DTU mode.

It will fail with this error below

Msg 40619, Level 16, State 1, Line 1

The edition 'Standard' does not support the database data max size '3221225472'.

 

Akshay_Manjeshwar_0-1677687793006.png

 

We cant fix this error by adding maxsize parameter as maxsize is not supported in the create db as copy of syntax

 

Akshay_Manjeshwar_2-1677687842790.png

 

The only way to fix this issue is to make sure the source db (testcopy in my example above) has one of the supported max size for the target db(DTU based) in this chart below: 

 

Akshay_Manjeshwar_3-1677687876378.png

 

Workaround/Fix:

Check for what are the different MAXSIZE options available for the target SLO and change the maxsize of the Source db. 

For example: In my case, target SLO is S2 and 5 GB is one of the supported options as you can see from the above chart. 

1. alter database testcopy modify (MAXSIZE = 5 GB);

 

Akshay_Manjeshwar_6-1677687974505.png

 

     2. Then you can run the create database as copy of command below and it will work. 

Akshay_Manjeshwar_5-1677687911939.png

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.