Hi
Raj0125 •,
Welcome to Microsoft Q&A forum and thanks for using Azure Services.
As I understand, you want to create Partition on existing tables in Azure SQL Database.
Below is a basic T-SQL example to create a new partition function, partition scheme, and partition an existing table. The DDL for your specific need will vary depending on the indexes on the existing tables and whether you want to partition those as well (align).
--create function with yearly boundaries
CREATE PARTITION FUNCTION PF_DatetimeExample (datetime)
AS RANGE RIGHT FOR VALUES('20180101','20190101','20200101','20210101');
--create scheme for the function
CREATE PARTITION SCHEME PS_DatetimeExample
AS PARTITION PF_TEST ALL TO ([PRIMARY]);
--partition the table
CREATE CLUSTERED INDEX cdx ON dbo.YourTable(YourDatetimeColumn)
ON PS_DatetimeExample(YourDatetimeColumn);
With Azure SQL Database, just specify the PRIMARY for all filegroups in the partition scheme.
Reference Q&A post: https://learn.microsoft.com/en-us/answers/questions/133553/partitioning-existing-tables-in-azure-sql-database
and Document link: https://learn.microsoft.com/en-us/sql/relational-databases/partitions/create-partitioned-tables-and-indexes?view=sql-server-ver16
Please let us know if this helps. If not, please share more details of the ask so that we can help.
Thank you.