views:

36

answers:

2

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

Is it possible to create a unique index on the view?

+2  A: 

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

SQLMenace
That sucks. Thanks!
Alex
+2  A: 

Indexed views cannot contain the UNION operator: see here

Ken Keenan