开发者

Add Unique Index on Union View (SQL Server 2008)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜