CREATE TABLE dbo.test --创建表
(
num decimal(4,2),
id int
)
GO
CREATE CLUSTERED INDEX IX_TEST_TNAME ON dbo.test(num) --创建聚集索引
GO
CREATE VIEW dbo.v_test with schemabinding --创建架构绑定视图
AS
SELECT num,id FROM dbo.test
GO
CREATE UNIQUE CLUSTERED INDEX IX_TEST_TNAME ON dbo.v_test(id) --是视图上构建唯一聚集索引
GO