开发者

Add Unique Index on Union View (SQL Server 2008)

开发者 https://www.devze.com 2023-01-05 19:24 出处:网络
I have a view which combines two tables using UNION ALL. Is it possible to 开发者_如何学JAVAcreate a unique index on the view?No, you cannot create an indexed view if the view is using UNION, this w

I have a view which combines two tables using UNION ALL.

Is it possible to 开发者_如何学JAVAcreate a unique index on the view?


No, you cannot create an indexed view if the view is using UNION, this was true in SQL 2000 and is still true in 2008, see also http://msdn.microsoft.com/en-us/library/dd171921(SQL.100).aspx


Indexed views cannot contain the UNION operator: see here

0

精彩评论

暂无评论...
验证码 换一张
取 消