Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to get already existing Partitioning code

Author  Topic 

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2007-10-09 : 13:56:03
I have a partitioned table
I need to migrate this table to some other DB
Therefore first I need to create the corresponding partition function and scheme on the destination DB
but I am not able to generate script of these
does anyone knows how we can generate script for already created partition function and scheme

thanks in advance

Kristen
Test

22859 Posts

Posted - 2007-10-09 : 13:58:55
Can't you just "Generate SQL" for the Table and the Partition Views?

"I need to create the corresponding partition function "

Do you mean that there is a Function involved? or a View perhaps?

Kristen
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-09 : 22:22:58
Tried sys.partition_functions?
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2007-10-10 : 15:51:10
Take a look at BOL for $PARTITION.
Go to Top of Page

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2007-10-15 : 01:24:38
sorry for the late reply
this is still not solved,following is the result obtained from given suggestions

table script gives following
CREATE TABLE [dbo].[part_table]([id] [int] NULL) ON [partscheme]([id])

sys.partition_functions gives only details of partition function and not its code

$PARTITION also does not gives code for the corresponding partition function and scheme
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2007-10-15 : 14:53:33
Using management studio in the object explorer, look under <database name>/Storage - There you will find Partion Schemas and Partition Functions. From there you can script the objects.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-15 : 21:52:05
Check syntax of 'create partition function' and 'create partition schema' in books online, you can build those statements with detailed info from sys.partition_functions.
Go to Top of Page

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2007-10-21 : 00:38:27
Lamprey,
Thanks for the help
I was looking for that only
thank you once again
this has been solved

Go to Top of Page
   

- Advertisement -