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

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.