I mentioned that we can not get the script of the partitioned tables by right clicking on the SSMS and using the Script To .. method on the article named “How To Get Script of Some Objects in the Database On SQL Server(Generate Script Method)“.
You can use Generate Script method for this operation.
You can find the details in the related article.
To get the script of the partitioned tables, we first need to find out which tables are partitioned in the database.
With the help of the following script you can find partitioned tables in your database.
1 2 3 4 5 |
select distinct tbl.name from sys.partitions ptt inner join sys.tables tbl on ptt.object_id = tbl.object_id where ptt.partition_number <> 1 |