|
miranwar
Posting Yak Master
125 Posts |
Posted - 2003-03-04 : 12:20:13
|
| Hi Can Somebody help me I am trying to create an indexed view. One of the requirements is that the view sould be Schemabindinding. This is the SQl i am running:Create view prVBoothSummary (iOwnerId, iOrderNumber, iOrderLineNumber, chRevTypeCd, chRevItemCd, Area, Length, Width, Opensides,--FE added to include opensides OrderStatus, OrderDate, chShowCd, iShowYear, Totalprice, Taxes, Baseprice, Unitprice, iContactId, chSourceCd ) WITH SCHEMABINDING asselect OH.iOwnerId, OH.iOrderNumber, OD.iOrderLineNumber, OD.chRevTypeCd, OD.chRevItemCd, OD.iQtyOrdered, ODA1.vchAttributeValue, ODA2.vchAttributeValue, ODA3.vchAttributeValue, OD.chOrderlineStatus, OH.dtInsertDate, OH.chShowCd, OH.iShowYear, OD.mTotalPrice, OD.mTaxTotal, OD.mBasePrice, OD.mUnitPrice, I.iindividualId, OH.chSourceCdfrom omOrderHeader omOrderDetail OD, omOrderDetailAttributes ODA1, omOrderDetailAttributes ODA2, --Added to include opensides omOrderDetailAttributes ODA3, omRevType RT, Individual I where OH.iOrderNumber = OD.iOrderNumber and OD.chRevTypeCd = RT.chRevTypeCd and RT.bBoothFlag = 1 and ODA1.iOrderNumber = OD.iOrderNumber and ODA1.iOrderLineNumber = OD.iOrderLineNumber and ODA1.chAttributeCd = RT.chBoothLengthAttribute and ODA2.iOrderNumber = OD.iOrderNumber and ODA2.iOrderLineNumber = OD.iOrderLineNumber and ODA2.chAttributeCd = RT.chBoothWidthAttribute and --Added to include opensides ODA3.iOrderNumber = OD.iOrderNumber and ODA3.iOrderLineNumber = OD.iOrderLineNumber and ODA3.chAttributeCd not in ('Hall','length','Width','Location','Pavilion') and OH.isignerid *= I.iindividualid However i am geeting the following error messageServer: Msg 4512, Level 16, State 3, Procedure prVBoothSummary, Line 39Cannot schema bind view 'prVBoothSummary' because name 'omOrderHeader' is invalid for schema binding. Names must be in two-part format and an object cannot reference itself.Can anybody help |
|