September 24, 2008 at 6:39 am
My View is like this
CREATE VIEW dbo.V_CODE_SUBCODES
WITH SCHEMABINDING
AS
SELECT TOP 100 PERCENT W.CODE, S.BIN, COUNT_BIG (W.CODE) AS QTY
FROM dbo.T_WAFER_SUBCODES S INNER JOIN
dbo.T_WAFERS W ON S.WAFER = W.WAFER
GROUP BY W.CODE, S.BIN
and was trying to create an index
CREATE UNIQUE CLUSTERED
INDEX [IX_V_CODE_SUBCODES] ON [dbo].[V_CODE_SUBCODES] (, [BIN])
And I get the error.
Msg 1936, Level 16, State 1, Line 1
Cannot index the view 'PRODENG.dbo.V_CODE_SUBCODES'. It contains one or more disallowed constructs.
Since I'm using an inner join, I thought it would be ok.
Thanks
Martin
September 24, 2008 at 7:04 am
There's no problem with the INNER JOIN, it's the TOP 100 PERCENT that it's complaining about.
Why do you need the TOP 100 PERCENT?
September 24, 2008 at 7:12 am
The only time I have ever needed "top 100 percent" is when I wanted an "order by" in the view.
I don't believe you need it in this case.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
September 24, 2008 at 8:55 am
I sooo missed that, I built the origional query with an order by in the EM, and it automatically puts that statement in...
Awsome, worked a treat. It's a shame that the error message wasn't a bit more helpfull.
Thanks guys.
Martin
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply