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)
 Table Partition

Author  Topic 

Surajit Laha
Starting Member

2 Posts

Posted - 2009-04-01 : 06:53:09
I want to create partition in one table the following are the syntax have used but last giving some error.

1. CREATE PARTITION FUNCTION GLFunction1(int)
AS RANGE RIGHT FOR VALUES (1000);

result : sucessful

2. CREATE PARTITION SCHEME GLScheme1
AS PARTITION GLFunction1
TO (laha,laha1);


result : sucessful

3. IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CRONUS India Ltd_$G_L Entry]') AND name = N'CRONUS India Ltd_$G_L Entry$0')
ALTER TABLE [dbo].[CRONUS India Ltd_$G_L Entry] DROP CONSTRAINT [CRONUS India Ltd_$G_L Entry$0]


result : sucessful

4. ALTER TABLE [dbo].[CRONUS India Ltd_$G_L Entry] ADD CONSTRAINT [CRONUS India Ltd_$G_L Entry$0] PRIMARY KEY CLUSTERED
(
[Entry No_] ASC
)WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [GLScheme1]

Result : error.
Msg 2726, Level 16, State 1, Line 1
Partition function 'GLFunction1' uses 1 columns which does not match with the number of partition columns used to partition the table or index.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-01 : 07:01:46
See http://weblogs.sqlteam.com/peterl/archive/2008/06/12/Horizontal-partitioning-Enterprise-style.aspx



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Surajit Laha
Starting Member

2 Posts

Posted - 2009-04-01 : 08:14:23
thanks for the info.




quote:
Originally posted by Peso

See http://weblogs.sqlteam.com/peterl/archive/2008/06/12/Horizontal-partitioning-Enterprise-style.aspx



E 12°55'05.63"
N 56°04'39.26"


Go to Top of Page
   

- Advertisement -