0

I want to create a partition in SQL Managed Instace, therefore I create a file group:

ALTER DATABASE megasqldw
ADD FILEGROUP fg_actividades_2022;

That´s OK.

Then when I try to add a file for this file group:

ALTER DATABASE megasqldw
ADD FILE
(
  NAME = activ_2022,
  FILENAME = 'F:\data\activ_2022.ndf',
    SIZE = 1000MB,
    MAXSIZE = 5000MB,
    FILEGROWTH = 500MB
)
TO FILEGROUP fg_actividades_2022;

I see this error:

Msg 41903, Level 16, State 1, Line 37
FILENAME option is not allowed in SQL Database Managed Instance.

How could I solve it?

jarlh
  • 42,561
  • 8
  • 45
  • 63
user3319338
  • 41
  • 1
  • 2
  • 9

1 Answers1

0

When using a managed instance, remove the FILENAME parameter and associated value from the ALTER DATABASE ADD FILE command. Azure SQL managed instance will determine the file path for you automatically. Azure SQL Managed Instance will automatically configure the path for all database files added. The ALTER DATABASE ADD FILE command in Azure SQL Managed Instance does not allow the FILENAME parameter. If you are using a SQL Server instance, customize the value for the FILENAME parameter to a location appropriate for your instance.

For reference: Read more here you have not: https://learn.microsoft.com/en-us/sql/relational-databases/partitions/create-partitioned-tables-and-indexes?view=sql-server-ver16

Oury-MSFT
  • 181
  • 3