Getting error creating database in SQL Elastic Pool, but can do it through the portal

Joe DeNicola 0 Reputation points
2024-12-26T21:50:02.2966667+00:00

I have a SQL Elastic Pool, MyPool, configured with 200 eDTUs and 800 GB storage

It contains a database, DBPrimary, with data space used = 127 GB, max storage = 300 GB

I have another database outside of the pool, DBProd, with data space used = 117 GB, Max Storage = 320 GB

I want to create a copy of DBProd in MyPool using a script.

I run these commands:

DROP DATABASE IF EXISTS DBCopy
CREATE DATABASE DBCopy AS COPY OF DBProd (SERVICE_OBJECTIVE = ELASTIC_POOL (name = MyPool))

I get this error:

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

However, I ran the following command to create the copy outside of the pool:

CREATE DATABASE DBCopy AS COPY OF DBProd

Then in the Azure Portal, I added DBCopy to the SQL Elastic Pool manually, and it did it without any errors.

So what is the correct command so that I can create the copy of the database directly in the pool?

I tried adding the MAXSIZE parameter to the CREATE TABLE command but it gives me a syntax error.

I tried adding the EDITION = 'GeneralPurpose' and it didn't help.

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Mahesh Kurva 1,625 Reputation points Microsoft Vendor
    2024-12-27T23:59:57.1533333+00:00

    Hi @Joe DeNicola,

    Thanks for the response.

    I am seeing an error code 45350 in the activity log when I try to move it into the pool, or if I try to change the edition/service tier/maxsize.

    The error code 45350 typically indicates that the database size exceeds the maximum allowed size for the specified service tier or elastic pool.User's image Adjust the service tier and size to fit within the pool’s limits:

    ALTER DATABASE DBCopy MODIFY (SERVICE_OBJECTIVE = 'S3', MAXSIZE = 250 GB);
    

    After adjusting the MAXSIZE, you can then move the database into the elastic pool.

    For more information, please refer the documents:

    https://zcusa.951200.xyz/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors-41400-to-49999?view=sql-server-ver16

    https://zcusa.951200.xyz/en-us/azure/azure-sql/database/resource-limits-dtu-single-databases?view=azuresql#standard-service-tier

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.