Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The view is NOT SCHEMA BOUND

Status
Not open for further replies.

raselwasel

Programmer
Dec 12, 2003
9
0
0
PH
I created a view in SQL Server 2000 Query Analyzer and I wanted to create an index for it. But when I tried to run my create index syntax, this error message appeared:

Cannot create index on view 'VTSAMPLE' because the view is not schema bound.

Does anybody here know the meaning of this? Your replies will be greatly appreciated.

To better get a clear view of what i'm saying, here's the code i used to create an index:

CREATE INDEX myindex ON VIEW_SAMPLE (col1, col2 ASC)

thanks!
 
From the top of my head, I think the problems lies with the view, not the creating of the index.

Schema bound means using "table1.col1" in stead of just "col1". Also use CREATE VIEW blabla WITH SCHEMABINDING. See books online, keyword "create view":

CREATE VIEW [< owner > . ] view_name [ ( column [ ,...n ] ) ]
[ WITH < view_attribute > [ ,...n ] ]
AS
select_statement
[ WITH CHECK OPTION ]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top