I have created following view named FDIP_ITEMS :-
CREATE VIEW FDIP_ITEM AS
SELECT DISTINCT A.ROWID,A.A_CODE,A.I_CODE,'P02' PHP,'NOS' UNIT FROM PHP_STOCK A WHERE PEND_QTY>0
SELECT DISTINCT ROWID,A_CODE,I_CODE,'' PHP,'NOS' UNIT FROM FDIP_RMSTK
It is taking 2 minutes to out result so i want to create index on a_code and i_code columns. But when i am creating index through SQL M.Studio it is showing following error:-
Cannot create index on view 'FDIP_ITEM' because the view is not schema bound. (Microsoft SQL Server, Error: 1939)
Tell me how to overcome this problem/error.
Please tell me where i am doing wrong and it is okey to create index on this view.