sanjdhiman
Programmer
Hi
Im new to partitioned Tables and views
I have set up my tables in the following way
CREATE TABLE [dbo].[dec04] (
[Id] [int] NOT NULL ,
[businessDate] [smalldatetime] NOT NULL
CHECK (DATEPART(mm, businessDate) = 12) ,
[price] [smallint] NOT NULL
) ON [PRIMARY]
I do this for 2 other tables [nov04] and [oct04].
I add in my COMPOUND primary key, which is based on id, businessdate and price.
Check constraint is on one of the Primary key members so should be ok.
Next I create a view which UNIONs up all these tables
CREATE VIEW all AS
select *
from dec04
UNION ALL
select *
from nov04
UNION ALL
select *
from oct04
GO
Ok that is fine too.
Then when i go to insert data into the view using the following
INSERT INTO all VALUES (1, '12-01-04', 2)
This doesnt work it gives me the following error message, i have searched google for it but no luck. Please help thanks.
UNION ALL view 'all'is not updatable because a partitioning column was not found.
I tried to update the view - refresh it using sp_refreshview. but no luck.....
thank you for your help in advance
Sanj
GO
Im new to partitioned Tables and views
I have set up my tables in the following way
CREATE TABLE [dbo].[dec04] (
[Id] [int] NOT NULL ,
[businessDate] [smalldatetime] NOT NULL
CHECK (DATEPART(mm, businessDate) = 12) ,
[price] [smallint] NOT NULL
) ON [PRIMARY]
I do this for 2 other tables [nov04] and [oct04].
I add in my COMPOUND primary key, which is based on id, businessdate and price.
Check constraint is on one of the Primary key members so should be ok.
Next I create a view which UNIONs up all these tables
CREATE VIEW all AS
select *
from dec04
UNION ALL
select *
from nov04
UNION ALL
select *
from oct04
GO
Ok that is fine too.
Then when i go to insert data into the view using the following
INSERT INTO all VALUES (1, '12-01-04', 2)
This doesnt work it gives me the following error message, i have searched google for it but no luck. Please help thanks.
UNION ALL view 'all'is not updatable because a partitioning column was not found.
I tried to update the view - refresh it using sp_refreshview. but no luck.....
thank you for your help in advance
Sanj
GO