views:

82

answers:

2

Hi All,

I have a select query to retrieve data from tables. It is working fine, but when i give some where condition to select some 3 values, it is not giving me the result.

it says, "Query processor ran out of Internal resources".

I thought through INDEX, it may work fine, then i created view with that select statement. But i couldn't create index.

It says, "View is not schema bound"

I dont know what to do. Please help me...

+1  A: 

I would guess that you are trying to create the index on the view instead of the underlying tables. if you truly need to index the view it must meet these criteria:

http://technet.microsoft.com/en-us/library/cc917715.aspx

Good luck

JasonHorner
+1  A: 

In order to create an indexed view the view needs to be schema bound to the entities that it is a view over.

To make a view schema bound, simply specify simply use WITH SCHEMABINDING in the view CREATE / UPDATE query, for example:

CREATE VIEW MyView
WITH SCHEMABINDING 
AS
-- SELECT

See this link for more information on schema binding, or the MSDN page on the CREATE VIEW statement.

However from what you have said I don't think the indexed view will necessarily help you - the message "Query processor ran out of Internal resources" means that the query processor failed to produce an execution plan for your query, which I would guess only happens with extremely complex queries.

You should try to reduce the complexity of your query somehow.

Kragen