declare @s varchar(1000)
set @s = 'CREATE VIEW dbo.v1 AS (select * from '+@table1+') union all (select * from '+@table2+')'
exec (@s)
set @s = 'CREATE VIEW dbo.v1 AS (select * from '+@table1+') union all (select * from '+@table2+')'
exec (@s)
UNION ALL 视图 'pm_ifcodeRptC_de_all_V' 不可更新,因为没有找到分区列。
请高手帮忙
(CustomerID INTEGER PRIMARY KEY
CHECK (CustomerID BETWEEN 1 AND 32999),
... -- Additional column definitions)
CREATE TABLE Customer_66
(CustomerID INTEGER PRIMARY KEY
CHECK (CustomerID BETWEEN 33000 AND 65999),
... -- Additional column definitions)
CREATE TABLE Customer_99
(CustomerID INTEGER PRIMARY KEY
CHECK (CustomerID BETWEEN 66000 AND 99999),
... -- Additional column definitions)CREATE VIEW Customers AS
SELECT * FROM Customers_33
UNION ALL
SELECT * FROM Customers_66
UNION ALL
SELECT * FROM Customers_99
-----------------------------------------------------------------
CustomerID 即为分区列
pubdate between and
7月份的表:pubdate between '2003-07-01' and '2003-07-31'
...................................................
constraint pk_table_200306 primary key (cid,yearmonth))
create table table_200307 (cid varchar(10),iid int,cvalue varchar(10),yearmonth int not null default 200307 check(yearmonth=200307),
constraint pk_table_200307 primary key (cid,yearmonth))