Problemer med sql statement, cannot call method on nvarchar.
Hej.Først lige lidt om applikationerne jeg arbejder med.
Jeg arbejder i SQL server Business Intelligence Development studio. Hvor jeg er i gang med at configure default OLAP cubes for microsoft Dynamics AX, Efter jeg har redigeret en *Named Query", får jeg følgende fejl. Deferred prepare could not be completed. Statement(s) could not be prepared. Cannot call method on nVarchar. Her er min SQL statement.
SELECT CUSTTABLE.ACCOUNTNUM, CUSTTABLE.CASHDISC, CUSTTABLE.SHIPCARRIERBLINDSHIPMENT, CUSTTABLE.PARTYTYPE, CUSTTABLE.PARTYID,
CUSTTABLE.SHIPCARRIERACCOUNTCODE, CUSTTABLE.PROJPRICEGROUP, CUSTTABLE.GIROTYPEFREETEXTINVOICE, CUSTTABLE.SYNCENTITYID,
CUSTTABLE.SYNCVERSION, CUSTTABLE.MEMO, CUSTTABLE.SALESDISTRICTID, CUSTTABLE.CURRENCY, CUSTTABLE.SEGMENTID, CUSTTABLE.SUBSEGMENTID,
CUSTTABLE.RFIDITEMTAGGING, CUSTTABLE.RFIDCASETAGGING, CUSTTABLE.RFIDPALLETTAGGING, CUSTTABLE.COMPANYCHAINID, CUSTTABLE.MAINCONTACTID,
CUSTTABLE.INTERCOMPANYAUTOCREATEORDERS, CUSTTABLE.IDENTIFICATIONNUMBER, CUSTTABLE.PARTYCOUNTRY, CUSTTABLE.PARTYSTATE,
CUSTTABLE.ORGID, CUSTTABLE.SALESGROUP, CUSTTABLE.BLOCKED, CUSTTABLE.ONETIMECUSTOMER, CUSTTABLE.ACCOUNTSTATEMENT,
CUSTTABLE.CREDITMAX, CUSTTABLE.MANDATORYCREDITLIMIT, CUSTTABLE.DIMENSION, CUSTTABLE.DIMENSION2_, CUSTTABLE.DIMENSION3_,
CUSTTABLE.NAME, CUSTTABLE.VENDACCOUNT, CUSTTABLE.TELEX, CUSTTABLE.PRICEGROUP, CUSTTABLE.MULTILINEDISC, CUSTTABLE.ENDDISC,
CUSTTABLE.VATNUM, CUSTTABLE.COUNTRYREGIONID, CUSTTABLE.INVENTLOCATION, CUSTTABLE.DLVTERM, CUSTTABLE.DLVMODE, CUSTTABLE.ADDRESS,
CUSTTABLE.MARKUPGROUP, CUSTTABLE.CLEARINGPERIOD, CUSTTABLE.ZIPCODE, CUSTTABLE.STATE, CUSTTABLE.COUNTY, CUSTTABLE.URL,
CUSTTABLE.EMAIL, CUSTTABLE.CELLULARPHONE, CUSTTABLE.PHONELOCAL, CUSTTABLE.FREIGHTZONE, CUSTTABLE.PHONE, CUSTTABLE.CREDITRATING,
CUSTTABLE.TAXGROUP, CUSTTABLE.STATISTICSGROUP, CUSTTABLE.PAYMMODE, CUSTTABLE.COMMISSIONGROUP, CUSTTABLE.BANKACCOUNT,
CUSTTABLE.PAYMSCHED, CUSTTABLE.NAMEALIAS, CUSTTABLE.CONTACTPERSONID, CUSTTABLE.INVOICEADDRESS, CUSTTABLE.TELEFAX,
CUSTTABLE.OURACCOUNTNUM, CUSTTABLE.SALESPOOLID, CUSTTABLE.INVOICEACCOUNT, CUSTTABLE.INCLTAX, CUSTTABLE.CUSTITEMGROUPID,
CAST(FLOOR(CAST(CUSTTABLE.MODIFIEDDATETIME AS FLOAT)) AS DATETIME) AS MODIFIEDDATETIME,
CAST(FLOOR(CAST(CUSTTABLE.CREATEDDATETIME AS FLOAT)) AS DATETIME) AS CREATEDDATETIME, CUSTTABLE.DATAAREAID,
CUSTTABLE.NUMBERSEQUENCEGROUP, CUSTTABLE.LANGUAGEID, CUSTTABLE.PAYMDAYID, CUSTTABLE.LINEOFBUSINESSID, CUSTTABLE.RECID,
CUSTTABLE.DESTINATIONCODEID, CUSTTABLE.GIROTYPE, CUSTTABLE.SUPPITEMGROUPID, CUSTTABLE.GIROTYPEINTERESTNOTE, CUSTTABLE.CUSTGROUP,
CUSTTABLE.TAXLICENSENUM, CUSTTABLE.WEBSALESORDERDISPLAY, CUSTTABLE.PAYMSPEC, CUSTTABLE.BANKCENTRALBANKPURPOSETEXT,
CUSTTABLE.BANKCENTRALBANKPURPOSECODE, CUSTTABLE.CITY, CUSTTABLE.STREET, CUSTTABLE.PAGER, CUSTTABLE.SMS, CUSTTABLE.LINEDISC,
CUSTTABLE.INTERCOMPANYALLOWINDIRECTCRE80, CUSTTABLE.PBACUSTGROUPID, CUSTTABLE.PACKMATERIALFEELICENSENUM,
CUSTTABLE.EINVOICEEANNUM, CUSTTABLE.DLVREASON, CUSTTABLE.FORECASTDMPINCLUDE, CUSTTABLE.GIROTYPECOLLECTIONLETTER,
CUSTTABLE.PAYMTERMID, CUSTTABLE.SALESCALENDARID, CUSTTABLE.CUSTCLASSIFICATIONID, CUSTTABLE.INTERCOMPANYDIRECTDELIVERY,
CUSTTABLE.SHIPCARRIERACCOUNT, CUSTTABLE.GIROTYPEPROJINVOICE, CUSTTABLE.INVENTSITEID, CUSTTABLE.ORDERENTRYDEADLINEGROUPID,
CUSTTABLE.SHIPCARRIERID, CUSTTABLE.SHIPCARRIERFUELSURCHARGE, DIRPARTYTABLE.PREFIX AS DIRPARTYTABLE_PREFIX,
DIRPARTYTABLE.PROFESSIONALSUFFIX AS DIRPARTYTABLE_PROFESSIONALSUFFIX, DIRPARTYTABLE.FIRSTNAME AS DIRPARTYTABLE_FIRSTNAME,
DIRPARTYTABLE.MIDDLENAME AS DIRPARTYTABLE_MIDDLENAME, DIRPARTYTABLE.LASTNAME AS DIRPARTYTABLE_LASTNAME,
DIRPARTYTABLE.PARTYID AS DIRPARTYTABLE_PARTYID, DIRPARTYTABLE.NAMEALIAS AS DIRPARTYTABLE_NAMEALIAS,
DIRPARTYTABLE.MEMO AS DIRPARTYTABLE_MEMO, DIRPARTYTABLE.GENERATIONALSUFFIX AS DIRPARTYTABLE_GENERATIONALSUFFIX,
DIRPARTYTABLE.NAME AS DIRPARTYTABLE_NAME, DIRPARTYTABLE.SALUTATION AS DIRPARTYTABLE_SALUTATION,
CAST(FLOOR(CAST(DIRPARTYTABLE.MODIFIEDDATETIME AS FLOAT)) AS DATETIME) AS DIRPARTYTABLE_MODIFIEDDATETIME,
CAST(FLOOR(CAST(DIRPARTYTABLE.CREATEDDATETIME AS FLOAT)) AS DATETIME) AS DIRPARTYTABLE_CREATEDDATETIME,
DIRPARTYTABLE.DATAAREAID AS DIRPARTYTABLE_DATAAREAID, DIRPARTYTABLE.RECID AS DIRPARTYTABLE_RECID,
DIRPARTYTABLE.PERSONNAMEORDER AS DIRPARTYTABLE_PERSONNAMEORDER, DIRPARTYTABLE.LANGUAGEID AS DIRPARTYTABLE_LANGUAGEID,
DIRPARTYTABLE.TYPE AS DIRPARTYTABLE_TYPE, COMMISSIONSALESGROUP.NAME AS COMMISSIONSALESGROUP_NAME,
COMMISSIONSALESGROUP.GROUPID AS COMMISSIONSALESGROUP_GROUPID,
COMMISSIONSALESGROUP.DATAAREAID AS COMMISSIONSALESGROUP_DATAAREAID, COMMISSIONSALESGROUP.RECID AS COMMISSIONSALESGROUP_RECID,
ADDRESSCOUNTRYREGION.COUNTRYREGIONID AS ADDRESSCOUNTRYREGION_COUNTRYREGIONID,
ADDRESSCOUNTRYREGION.BANKACCOUNTNUMVALIDATION AS ADDRESSCOUNTRYREGION_BANKACCOUNTNUMVALIDATION,
ADDRESSCOUNTRYREGION.CURRENCYCODE AS ADDRESSCOUNTRYREGION_CURRENCYCODE,
ADDRESSCOUNTRYREGION.TAXVATNUMFORMATCHECK AS ADDRESSCOUNTRYREGION_TAXVATNUMFORMATCHECK,
ADDRESSCOUNTRYREGION.TIMEZONE AS ADDRESSCOUNTRYREGION_TIMEZONE,
ADDRESSCOUNTRYREGION.ADDRESSUSEZIPPLUS4 AS ADDRESSCOUNTRYREGION_ADDRESSUSEZIPPLUS4,
ADDRESSCOUNTRYREGION.TYPE AS ADDRESSCOUNTRYREGION_TYPE, ADDRESSCOUNTRYREGION.TAXCODE AS ADDRESSCOUNTRYREGION_TAXCODE,
ADDRESSCOUNTRYREGION.ISOCODE AS ADDRESSCOUNTRYREGION_ISOCODE,
ADDRESSCOUNTRYREGION.ADDRFORMAT AS ADDRESSCOUNTRYREGION_ADDRFORMAT,
ADDRESSCOUNTRYREGION.NAME AS ADDRESSCOUNTRYREGION_NAME, ADDRESSCOUNTRYREGION.DATAAREAID AS ADDRESSCOUNTRYREGION_DATAAREAID,
ADDRESSCOUNTRYREGION.RECID AS ADDRESSCOUNTRYREGION_RECID,
ADDRESSCOUNTRYREGION.INTRASTATCODE AS ADDRESSCOUNTRYREGION_INTRASTATCODE,
ADDRESSCOUNTRYREGION.GIROACCOUNTVALIDATIONMETHOD AS ADDRESSCOUNTRYREGION_GIROACCOUNTVALIDATIONMETHOD,
CUSTGROUP.CUSTGROUP AS CUSTGROUP_CUSTGROUP, CUSTGROUP.NAME AS CUSTGROUP_NAME,
CUSTGROUP.CLEARINGPERIOD AS CUSTGROUP_CLEARINGPERIOD, CUSTGROUP.PAYMTERMID AS CUSTGROUP_PAYMTERMID,
CUSTGROUP.TAXGROUPID AS CUSTGROUP_TAXGROUPID, CUSTGROUP.DATAAREAID AS CUSTGROUP_DATAAREAID, CUSTGROUP.RECID AS CUSTGROUP_RECID,
CUSTTABLE.CUSTGROUP.PAYMIDTYPE AS CUSTGROUP_PAYMIDTYPE, INVENTSITE.SITEID AS INVENTSITE_SITEID, INVENTSITE.NAME AS INVENTSITE_NAME,
INVENTSITE.DIMENSION AS INVENTSITE_DIMENSION, INVENTSITE.DIMENSION2_ AS INVENTSITE_DIMENSION2_,
INVENTSITE.DIMENSION3_ AS INVENTSITE_DIMENSION3_, INVENTSITE.DATAAREAID AS INVENTSITE_DATAAREAID, INVENTSITE.RECID AS INVENTSITE_RECID,
INVENTSITE.TIMEZONE AS INVENTSITE_TIMEZONE, INVENTSITE.ORDERENTRYDEADLINEGROUPID AS INVENTSITE_ORDERENTRYDEADLINEGROUPID,
SMMBUSRELCHAINGROUP.DATAAREAID AS SMMBUSRELCHAINGROUP_DATAAREAID, SMMBUSRELCHAINGROUP.RECID AS SMMBUSRELCHAINGROUP_RECID,
SMMBUSRELCHAINGROUP.CHAINID AS SMMBUSRELCHAINGROUP_CHAINID,
SMMBUSRELCHAINGROUP.DESCRIPTION AS SMMBUSRELCHAINGROUP_DESCRIPTION,
SMMBUSRELSEGMENTGROUP.DATAAREAID AS SMMBUSRELSEGMENTGROUP_DATAAREAID,
SMMBUSRELSEGMENTGROUP.RECID AS SMMBUSRELSEGMENTGROUP_RECID,
SMMBUSRELSEGMENTGROUP.SEGMENTID AS SMMBUSRELSEGMENTGROUP_SEGMENTID,
SMMBUSRELSEGMENTGROUP.DESCRIPTION AS SMMBUSRELSEGMENTGROUP_DESCRIPTION,
LINEOFBUSINESS.LINEOFBUSINESSID AS LINEOFBUSINESS_LINEOFBUSINESSID, LINEOFBUSINESS.DESCRIPTION AS LINEOFBUSINESS_DESCRIPTION,
LINEOFBUSINESS.DATAAREAID AS LINEOFBUSINESS_DATAAREAID, LINEOFBUSINESS.RECID AS LINEOFBUSINESS_RECID,
DESTINATIONCODE.DESTINATIONCODEID AS DESTINATIONCODE_DESTINATIONCODEID, DESTINATIONCODE.DESCRIPTION AS DESTINATIONCODE_DESCRIPTION,
DESTINATIONCODE.DATAAREAID AS DESTINATIONCODE_DATAAREAID, DESTINATIONCODE.RECID AS DESTINATIONCODE_RECID
FROM CUSTTABLE LEFT OUTER JOIN
DIRPARTYTABLE ON DIRPARTYTABLE.DATAAREAID = CUSTTABLE.DATAAREAID AND DIRPARTYTABLE.PARTYID = CUSTTABLE.PARTYID LEFT OUTER JOIN
COMMISSIONSALESGROUP ON COMMISSIONSALESGROUP.DATAAREAID = CUSTTABLE.DATAAREAID AND
COMMISSIONSALESGROUP.GROUPID = CUSTTABLE.SALESGROUP LEFT OUTER JOIN
ADDRESSCOUNTRYREGION ON ADDRESSCOUNTRYREGION.DATAAREAID = CUSTTABLE.DATAAREAID AND
ADDRESSCOUNTRYREGION.COUNTRYREGIONID = CUSTTABLE.COUNTRYREGIONID LEFT OUTER JOIN
CUSTGROUP ON CUSTGROUP.DATAAREAID = CUSTTABLE.DATAAREAID AND CUSTGROUP.CUSTGROUP = CUSTTABLE.CUSTGROUP LEFT OUTER JOIN
INVENTSITE ON INVENTSITE.DATAAREAID = CUSTTABLE.DATAAREAID AND INVENTSITE.SITEID = CUSTTABLE.INVENTSITEID LEFT OUTER JOIN
SMMBUSRELCHAINGROUP ON SMMBUSRELCHAINGROUP.DATAAREAID = CUSTTABLE.DATAAREAID AND
SMMBUSRELCHAINGROUP.CHAINID = CUSTTABLE.COMPANYCHAINID LEFT OUTER JOIN
SMMBUSRELSEGMENTGROUP ON SMMBUSRELSEGMENTGROUP.DATAAREAID = CUSTTABLE.DATAAREAID AND
SMMBUSRELSEGMENTGROUP.SEGMENTID = CUSTTABLE.SEGMENTID LEFT OUTER JOIN
LINEOFBUSINESS ON LINEOFBUSINESS.DATAAREAID = CUSTTABLE.DATAAREAID AND
LINEOFBUSINESS.LINEOFBUSINESSID = CUSTTABLE.LINEOFBUSINESSID LEFT OUTER JOIN
DESTINATIONCODE ON DESTINATIONCODE.DATAAREAID = CUSTTABLE.DATAAREAID AND
DESTINATIONCODE.DESTINATIONCODEID = CUSTTABLE.DESTINATIONCODEID
Håber nogen kan hjælpe.
På forhånd tak.