Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5
Hi All,
I'm still struggling with the same cube and this is my 3rd post and once i fix some thing the other breaks. Please forgive me. When i process my cube i'm getting the error:
Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5.
My question is when the error says column 5 (is it the column 5 in the DSV?) or is it the column 5 in the DIMENSION list?
My next question is the DSV Query works perfectly fine , so why this error in cube? This is what i have in the query in DSV.
Please need help. In the below query both the column 5 (ArEASSIGNED TO VENDOR) in the CUBE and underlying table have the same data type and length VARCHAR(4000). Why is the process failing still?
SELECT [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_0],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingsector]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_1],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseclosedflag]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_2],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casehasvendorinfo]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_3],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingstatus]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_4],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendor]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_5],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassignedtovendor]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_6],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentvendor]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_7],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoiced]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSInvoiced0_8],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatus]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_9],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casecloseddateid]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_10],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendordateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_11],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassigneddateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_12],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentassigneddateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_13],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingduedateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_14],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendormoweddateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_15],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[captypename] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_16],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetype] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseType0_17],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumbersubgroup] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_18],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetownship] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_19],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casestatus] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseStatus0_20],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseopendateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_21],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casereferredtolegalflag]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_22],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casemacinitiatedflag] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_23],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseconversionstatusdesc]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_24],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reasonforinvestigation] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_25],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[investigationopendateid]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_26],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[receiveddateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_27],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assigned_department_staff]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_28],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseinitiator] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_29],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendorinvoiceamount] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_30],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[inspection_result] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_31],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reason_for_complaint] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_32],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendor_action] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_33],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[complaint_source] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_34],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[contractcompliancevendor]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_35],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatusdateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_36],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_complaint_id] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_37],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_inspection_id] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_38],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumber] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseNumber0_39],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[parcelnumber] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_40],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[row_index] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSROW_INDEX0_41]
FROM (SELECT CASE Isnumeric(
accela_staging.dbo.fact_highweedsandgrassdetails.vendorinvoiceamount)
WHEN 1 THEN Cast(
fact_highweedsandgrassdetails.vendorinvoiceamount AS
VARCHAR(
10))
END AS
Total_Dollar_Amount,
fact_highweedsandgrassdetails.casenumber,
fact_highweedsandgrassdetails.row_index,
fact_highweedsandgrassdetails.mowingsector,
fact_highweedsandgrassdetails.caseclosedflag,
fact_highweedsandgrassdetails.casecloseddateid,
fact_highweedsandgrassdetails.maccomments,
fact_highweedsandgrassdetails.lastfeeinvoicedateid,
fact_highweedsandgrassdetails.casehasvendorinfo,
fact_highweedsandgrassdetails.mowingstatus,
fact_highweedsandgrassdetails.receiveddateid,
fact_highweedsandgrassdetails.assignedtovendordateid,
fact_highweedsandgrassdetails.assignedtovendor,
fact_highweedsandgrassdetails.reassigneddateid,
fact_highweedsandgrassdetails.reassignedtovendor,
fact_highweedsandgrassdetails.currentvendor,
fact_highweedsandgrassdetails.currentassigneddateid,
fact_highweedsandgrassdetails.mowingduedateid,
fact_highweedsandgrassdetails.vendormoweddateid,
fact_highweedsandgrassdetails.invoiced,
fact_highweedsandgrassdetails.invoicedstatus,
fact_highweedsandgrassdetails.invoicedstatusdateid,
fact_highweedsandgrassdetails.vendorinvoicenumber,
fact_highweedsandgrassdetails.vendorcomments,
fact_casedetails.captypename,
fact_casedetails.casenumbersubgroup,
fact_casedetails.casetype,
fact_casedetails.township AS
CaseTownship,
fact_casedetails.casestatus,
fact_casedetails.caseopendateid,
fact_casedetails.referredtolegalflag AS
CaseReferredToLegalFlag,
fact_casedetails.macinitiatedflag AS
CaseMACInitiatedFlag,
fact_casedetails.conversionstatusdesc AS
CaseConversionStatusDesc,
fact_casedetails.assignedstaff AS
CaseAssignedStaff,
fact_casedetails.completedstaff AS
CaseCompletedStaff,
fact_casedetails.closedbystaff AS
CaseClosedByStaff,
fact_casedetails.initiator AS
CaseInitiator,
fact_casedetails.reasonforinvestigation,
fact_casedetails.primaryaddress,
fact_casedetails.parcelnumber,
Cast(Datediff([day],
fact_highweedsandgrassdetails.receiveddatetime,
COALESCE (fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.recordimportdatetime)) AS
DECIMAL(6, 2))
AS
DaysOpen,
Cast(Datediff([day],
fact_highweedsandgrassdetails.receiveddatetime,
COALESCE
(fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.recordimportdatetime)) AS
NUMERIC(9, 2))
* 24 AS
HoursOpenToMow,
Cast(Datediff([day],
fact_highweedsandgrassdetails.assignedtovendordate,
COALESCE
(fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.recordimportdatetime)) AS
NUMERIC(9, 2))
* 24 AS
HoursAssignedToMow,
CASE
WHEN mowingstatus = 'Mowed'
OR mowingstatus = 'Closed' THEN 1
ELSE 0
END AS
NumberComplete,
fact_highweedsandgrassdetails.recordimportdatetime,
fact_casedetails.macsiebelnumber,
fact_highweedsandgrassdetails.mowingduedate,
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.lastfeeinvoicedate,
fact_highweedsandgrassdetails.investigationopendatetime,
fact_highweedsandgrassdetails.investigationopendate,
fact_highweedsandgrassdetails.investigationopendateid,
Cast(Datediff([day],
fact_highweedsandgrassdetails.investigationopendatetime,
CASE
WHEN
( vendormoweddatetime IS NOT NULL
AND vendormoweddatetime <=
fact_highweedsandgrassdetails.casecloseddate ) THEN
fact_highweedsandgrassdetails.vendormoweddatetime
ELSE
CASE
WHEN (
fact_highweedsandgrassdetails.casecloseddate IS
NOT NULL
AND fact_highweedsandgrassdetails.casecloseddate
<=
fact_highweedsandgrassdetails.recordimportdatetime )
THEN
fact_highweedsandgrassdetails.casecloseddate
ELSE fact_highweedsandgrassdetails.recordimportdatetime
END
END) AS NUMERIC(9, 2)) * 24 AS
AbatementDurationHoursOLD,
Cast(Datediff([day],
fact_highweedsandgrassdetails.investigationopendatetime,
CASE
WHEN
COALESCE (vendormoweddatetime,
fact_highweedsandgrassdetails.casecloseddate) IS
NOT NULL THEN COALESCE (vendormoweddatetime,
fact_highweedsandgrassdetails.casecloseddate)
ELSE
CASE
WHEN ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
AND fact_highweedsandgrassdetails.casecloseddate <=
fact_highweedsandgrassdetails.recordimportdatetime ) THEN
fact_highweedsandgrassdetails.casecloseddate
ELSE fact_highweedsandgrassdetails.recordimportdatetime
END
END) AS NUMERIC(9, 2)) * 24 AS
AbatementDurationHours,
fact_casedetails.assigneddepartment,
COALESCE (fact_casedetails.assignedstaff, '[null]')
+ '/'
+ COALESCE (fact_casedetails.assigneddepartment, '[null]') AS
Assigned_Department_Staff,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.receiveddatetime,
fact_highweedsandgrassdetails.assignedtovendordate,
fact_highweedsandgrassdetails.vendorinvoiceamount,
fact_highweedsandgrassdetails.invoicedstatusdate,
fact_highweedsandgrassdetails.complaint_source,
fact_highweedsandgrassdetails.inspection_result,
fact_highweedsandgrassdetails.reason_for_complaint,
fact_highweedsandgrassdetails.contractcompliancevendor,
fact_highweedsandgrassdetails.vendor_action,
fact_highweedsandgrassdetails.date_of_complaint_id,
fact_highweedsandgrassdetails.date_of_inspection_id,
CONVERT(INT, Replace(Replace(fact_highweedsandgrassdetails.casenumber,
'HWG', 0)
, '-', 0)) AS compliancejoin,
fact_highweedsandgrassdetails.maccomments AS Expr1,
dbo.dim_highweedscensustracts.b1_census_tract
FROM dbo.fact_highweedsandgrassdetails
INNER JOIN dbo.fact_casedetails
ON fact_highweedsandgrassdetails.casenumber =
fact_casedetails.casenumber
INNER JOIN dbo.dim_highweedscensustracts
ON fact_highweedsandgrassdetails.casenumber =
dbo.dim_highweedscensustracts.casenumber
GROUP BY fact_highweedsandgrassdetails.casenumber,
fact_highweedsandgrassdetails.row_index,
fact_highweedsandgrassdetails.mowingsector,
fact_highweedsandgrassdetails.caseclosedflag,
fact_highweedsandgrassdetails.casecloseddateid,
fact_highweedsandgrassdetails.maccomments,
fact_highweedsandgrassdetails.lastfeeinvoicedateid,
fact_highweedsandgrassdetails.casehasvendorinfo,
fact_highweedsandgrassdetails.mowingstatus,
fact_highweedsandgrassdetails.receiveddateid,
fact_highweedsandgrassdetails.assignedtovendordateid,
fact_highweedsandgrassdetails.assignedtovendor,
fact_highweedsandgrassdetails.reassigneddateid,
fact_highweedsandgrassdetails.reassignedtovendor,
fact_highweedsandgrassdetails.currentvendor,
fact_highweedsandgrassdetails.currentassigneddateid,
fact_highweedsandgrassdetails.mowingduedateid,
fact_highweedsandgrassdetails.vendormoweddateid,
fact_highweedsandgrassdetails.invoiced,
fact_highweedsandgrassdetails.invoicedstatus,
fact_highweedsandgrassdetails.invoicedstatusdateid,
fact_highweedsandgrassdetails.vendorinvoicenumber,
fact_highweedsandgrassdetails.vendorcomments,
fact_casedetails.captypename,
fact_casedetails.casenumbersubgroup,
fact_casedetails.casetype,
fact_casedetails.township,
fact_casedetails.casestatus,
fact_casedetails.caseopendateid,
fact_casedetails.referredtolegalflag,
fact_casedetails.macinitiatedflag,
fact_casedetails.conversionstatusdesc,
fact_casedetails.assignedstaff,
fact_casedetails.completedstaff,
fact_casedetails.closedbystaff,
fact_casedetails.initiator,
fact_casedetails.reasonforinvestigation,
fact_casedetails.primaryaddress,
fact_casedetails.parcelnumber,
fact_highweedsandgrassdetails.vendormoweddatetime,
Cast(Datediff([day],
fact_highweedsandgrassdetails.receiveddatetime,
COALESCE (
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.recordimportdatetime))
AS
NUMERIC(9, 2)),
Cast(Datediff([day],
fact_highweedsandgrassdetails.receiveddatetime,
COALESCE (
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.recordimportdatetime))
AS
NUMERIC(9, 2)),
Cast(Datediff([day],
fact_highweedsandgrassdetails.assignedtovendordate,
COALESCE (
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.recordimportdatetime))
AS
NUMERIC(9, 2)),
CASE
WHEN mowingstatus = 'Mowed'
OR mowingstatus = 'Closed' THEN 1
ELSE 0
END,
fact_highweedsandgrassdetails.recordimportdatetime,
fact_casedetails.macsiebelnumber,
fact_highweedsandgrassdetails.mowingduedate,
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.lastfeeinvoicedate,
fact_highweedsandgrassdetails.investigationopendatetime,
fact_highweedsandgrassdetails.investigationopendate,
fact_highweedsandgrassdetails.investigationopendateid,
Cast(Datediff([day],
fact_highweedsandgrassdetails.investigationopendatetime,
CASE
WHEN
( vendormoweddatetime IS NOT NULL
AND vendormoweddatetime <=
fact_highweedsandgrassdetails.casecloseddate ) THEN
fact_highweedsandgrassdetails.vendormoweddatetime
ELSE
CASE
WHEN (
fact_highweedsandgrassdetails.casecloseddate
IS NOT NULL
AND
fact_highweedsandgrassdetails.casecloseddate <=
fact_highweedsandgrassdetails.recordimportdatetime )
THEN
fact_highweedsandgrassdetails.casecloseddate
ELSE
fact_highweedsandgrassdetails.recordimportdatetime
END
END) AS NUMERIC(9, 2)),
Cast(Datediff(ss,
fact_highweedsandgrassdetails.investigationopendatetime,
CASE
WHEN
COALESCE (vendormoweddatetime,
fact_highweedsandgrassdetails.casecloseddate) IS
NOT NULL THEN COALESCE (vendormoweddatetime,
fact_highweedsandgrassdetails.casecloseddate)
ELSE
CASE
WHEN
( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
AND fact_highweedsandgrassdetails.casecloseddate <=
fact_highweedsandgrassdetails.recordimportdatetime ) THEN
fact_highweedsandgrassdetails.casecloseddate
ELSE fact_highweedsandgrassdetails.recordimportdatetime
END
END) AS NUMERIC(18, 2)) * 60,
fact_casedetails.assigneddepartment,
COALESCE (fact_casedetails.assignedstaff, '[null]')
+ '/'
+ COALESCE (fact_casedetails.assigneddepartment, '[null]'),
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.receiveddatetime,
fact_highweedsandgrassdetails.assignedtovendordate,
fact_highweedsandgrassdetails.vendorinvoiceamount,
fact_highweedsandgrassdetails.invoicedstatusdate,
fact_highweedsandgrassdetails.complaint_source,
fact_highweedsandgrassdetails.inspection_result,
fact_highweedsandgrassdetails.reason_for_complaint,
fact_highweedsandgrassdetails.contractcompliancevendor,
fact_highweedsandgrassdetails.vendor_action,
fact_highweedsandgrassdetails.date_of_complaint_id,
fact_highweedsandgrassdetails.date_of_inspection_id,
CONVERT(INT, Replace(
Replace(fact_highweedsandgrassdetails.casenumber, 'HWG', 0)
, '-', 0)),
fact_highweedsandgrassdetails.maccomments,
dbo.dim_highweedscensustracts.b1_census_tract) AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS]
ORDER BY [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
ASC
SV
I just counted the columns from the top:
1) compliancejoin, 2) mowingsector, 3) caseclosedflag, 4) casehasvendorinfo, 5) mowingstatus, 6) assignedtovendor.
I see now that your subject line talks about column 6, but you say column 5 in body of your original post.
I don't know anything about cubes, but apparently there is some mapping problem when you run it from SSAS. (I assume it is SSAS, a part of the product I'm entirely ignorant of.) I figured that if you had got tripped by the zero-based numbering, you
might be staring on the wrong column.
Erland Sommarskog, SQL Server MVP, [email protected]
Similar Messages
-
Hi All,
I'm still struggling with the same cube and this is my 3rd post and once i fix some thing the other breaks. Please forgive me. When i process my cube i'm getting the error:
Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5.
My question is when the error says column 5 (is it the column 5 in the DSV?) or is it the column 5 in the DIMENSION list?
My next question is the DSV Query works perfectly fine , so why this error in cube? This is what i have in the query in DSV.
Please need help. In the below query both the column 5 (ArEASSIGNED TO VENDOR) in the CUBE and underlying table have the same data type and length VARCHAR(4000). Why is the process failing still?
SELECT [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_0],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingsector]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_1],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseclosedflag]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_2],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casehasvendorinfo]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_3],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingstatus]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_4],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendor]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_5],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassignedtovendor]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_6],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentvendor]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_7],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoiced]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSInvoiced0_8],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatus]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_9],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casecloseddateid]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_10],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendordateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_11],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassigneddateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_12],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentassigneddateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_13],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingduedateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_14],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendormoweddateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_15],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[captypename] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_16],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetype] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseType0_17],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumbersubgroup] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_18],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetownship] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_19],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casestatus] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseStatus0_20],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseopendateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_21],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casereferredtolegalflag]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_22],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casemacinitiatedflag] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_23],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseconversionstatusdesc]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_24],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reasonforinvestigation] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_25],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[investigationopendateid]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_26],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[receiveddateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_27],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assigned_department_staff]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_28],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseinitiator] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_29],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendorinvoiceamount] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_30],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[inspection_result] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_31],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reason_for_complaint] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_32],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendor_action] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_33],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[complaint_source] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_34],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[contractcompliancevendor]
AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_35],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatusdateid] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_36],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_complaint_id] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_37],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_inspection_id] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_38],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumber] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseNumber0_39],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[parcelnumber] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_40],
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[row_index] AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSROW_INDEX0_41]
FROM (SELECT CASE Isnumeric(
accela_staging.dbo.fact_highweedsandgrassdetails.vendorinvoiceamount)
WHEN 1 THEN Cast(
fact_highweedsandgrassdetails.vendorinvoiceamount AS
VARCHAR(
10))
END AS
Total_Dollar_Amount,
fact_highweedsandgrassdetails.casenumber,
fact_highweedsandgrassdetails.row_index,
fact_highweedsandgrassdetails.mowingsector,
fact_highweedsandgrassdetails.caseclosedflag,
fact_highweedsandgrassdetails.casecloseddateid,
fact_highweedsandgrassdetails.maccomments,
fact_highweedsandgrassdetails.lastfeeinvoicedateid,
fact_highweedsandgrassdetails.casehasvendorinfo,
fact_highweedsandgrassdetails.mowingstatus,
fact_highweedsandgrassdetails.receiveddateid,
fact_highweedsandgrassdetails.assignedtovendordateid,
fact_highweedsandgrassdetails.assignedtovendor,
fact_highweedsandgrassdetails.reassigneddateid,
fact_highweedsandgrassdetails.reassignedtovendor,
fact_highweedsandgrassdetails.currentvendor,
fact_highweedsandgrassdetails.currentassigneddateid,
fact_highweedsandgrassdetails.mowingduedateid,
fact_highweedsandgrassdetails.vendormoweddateid,
fact_highweedsandgrassdetails.invoiced,
fact_highweedsandgrassdetails.invoicedstatus,
fact_highweedsandgrassdetails.invoicedstatusdateid,
fact_highweedsandgrassdetails.vendorinvoicenumber,
fact_highweedsandgrassdetails.vendorcomments,
fact_casedetails.captypename,
fact_casedetails.casenumbersubgroup,
fact_casedetails.casetype,
fact_casedetails.township AS
CaseTownship,
fact_casedetails.casestatus,
fact_casedetails.caseopendateid,
fact_casedetails.referredtolegalflag AS
CaseReferredToLegalFlag,
fact_casedetails.macinitiatedflag AS
CaseMACInitiatedFlag,
fact_casedetails.conversionstatusdesc AS
CaseConversionStatusDesc,
fact_casedetails.assignedstaff AS
CaseAssignedStaff,
fact_casedetails.completedstaff AS
CaseCompletedStaff,
fact_casedetails.closedbystaff AS
CaseClosedByStaff,
fact_casedetails.initiator AS
CaseInitiator,
fact_casedetails.reasonforinvestigation,
fact_casedetails.primaryaddress,
fact_casedetails.parcelnumber,
Cast(Datediff([day],
fact_highweedsandgrassdetails.receiveddatetime,
COALESCE (fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.recordimportdatetime)) AS
DECIMAL(6, 2))
AS
DaysOpen,
Cast(Datediff([day],
fact_highweedsandgrassdetails.receiveddatetime,
COALESCE
(fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.recordimportdatetime)) AS
NUMERIC(9, 2))
* 24 AS
HoursOpenToMow,
Cast(Datediff([day],
fact_highweedsandgrassdetails.assignedtovendordate,
COALESCE
(fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.recordimportdatetime)) AS
NUMERIC(9, 2))
* 24 AS
HoursAssignedToMow,
CASE
WHEN mowingstatus = 'Mowed'
OR mowingstatus = 'Closed' THEN 1
ELSE 0
END AS
NumberComplete,
fact_highweedsandgrassdetails.recordimportdatetime,
fact_casedetails.macsiebelnumber,
fact_highweedsandgrassdetails.mowingduedate,
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.lastfeeinvoicedate,
fact_highweedsandgrassdetails.investigationopendatetime,
fact_highweedsandgrassdetails.investigationopendate,
fact_highweedsandgrassdetails.investigationopendateid,
Cast(Datediff([day],
fact_highweedsandgrassdetails.investigationopendatetime,
CASE
WHEN
( vendormoweddatetime IS NOT NULL
AND vendormoweddatetime <=
fact_highweedsandgrassdetails.casecloseddate ) THEN
fact_highweedsandgrassdetails.vendormoweddatetime
ELSE
CASE
WHEN (
fact_highweedsandgrassdetails.casecloseddate IS
NOT NULL
AND fact_highweedsandgrassdetails.casecloseddate
<=
fact_highweedsandgrassdetails.recordimportdatetime )
THEN
fact_highweedsandgrassdetails.casecloseddate
ELSE fact_highweedsandgrassdetails.recordimportdatetime
END
END) AS NUMERIC(9, 2)) * 24 AS
AbatementDurationHoursOLD,
Cast(Datediff([day],
fact_highweedsandgrassdetails.investigationopendatetime,
CASE
WHEN
COALESCE (vendormoweddatetime,
fact_highweedsandgrassdetails.casecloseddate) IS
NOT NULL THEN COALESCE (vendormoweddatetime,
fact_highweedsandgrassdetails.casecloseddate)
ELSE
CASE
WHEN ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
AND fact_highweedsandgrassdetails.casecloseddate <=
fact_highweedsandgrassdetails.recordimportdatetime ) THEN
fact_highweedsandgrassdetails.casecloseddate
ELSE fact_highweedsandgrassdetails.recordimportdatetime
END
END) AS NUMERIC(9, 2)) * 24 AS
AbatementDurationHours,
fact_casedetails.assigneddepartment,
COALESCE (fact_casedetails.assignedstaff, '[null]')
+ '/'
+ COALESCE (fact_casedetails.assigneddepartment, '[null]') AS
Assigned_Department_Staff,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.receiveddatetime,
fact_highweedsandgrassdetails.assignedtovendordate,
fact_highweedsandgrassdetails.vendorinvoiceamount,
fact_highweedsandgrassdetails.invoicedstatusdate,
fact_highweedsandgrassdetails.complaint_source,
fact_highweedsandgrassdetails.inspection_result,
fact_highweedsandgrassdetails.reason_for_complaint,
fact_highweedsandgrassdetails.contractcompliancevendor,
fact_highweedsandgrassdetails.vendor_action,
fact_highweedsandgrassdetails.date_of_complaint_id,
fact_highweedsandgrassdetails.date_of_inspection_id,
CONVERT(INT, Replace(Replace(fact_highweedsandgrassdetails.casenumber,
'HWG', 0)
, '-', 0)) AS compliancejoin,
fact_highweedsandgrassdetails.maccomments AS Expr1,
dbo.dim_highweedscensustracts.b1_census_tract
FROM dbo.fact_highweedsandgrassdetails
INNER JOIN dbo.fact_casedetails
ON fact_highweedsandgrassdetails.casenumber =
fact_casedetails.casenumber
INNER JOIN dbo.dim_highweedscensustracts
ON fact_highweedsandgrassdetails.casenumber =
dbo.dim_highweedscensustracts.casenumber
GROUP BY fact_highweedsandgrassdetails.casenumber,
fact_highweedsandgrassdetails.row_index,
fact_highweedsandgrassdetails.mowingsector,
fact_highweedsandgrassdetails.caseclosedflag,
fact_highweedsandgrassdetails.casecloseddateid,
fact_highweedsandgrassdetails.maccomments,
fact_highweedsandgrassdetails.lastfeeinvoicedateid,
fact_highweedsandgrassdetails.casehasvendorinfo,
fact_highweedsandgrassdetails.mowingstatus,
fact_highweedsandgrassdetails.receiveddateid,
fact_highweedsandgrassdetails.assignedtovendordateid,
fact_highweedsandgrassdetails.assignedtovendor,
fact_highweedsandgrassdetails.reassigneddateid,
fact_highweedsandgrassdetails.reassignedtovendor,
fact_highweedsandgrassdetails.currentvendor,
fact_highweedsandgrassdetails.currentassigneddateid,
fact_highweedsandgrassdetails.mowingduedateid,
fact_highweedsandgrassdetails.vendormoweddateid,
fact_highweedsandgrassdetails.invoiced,
fact_highweedsandgrassdetails.invoicedstatus,
fact_highweedsandgrassdetails.invoicedstatusdateid,
fact_highweedsandgrassdetails.vendorinvoicenumber,
fact_highweedsandgrassdetails.vendorcomments,
fact_casedetails.captypename,
fact_casedetails.casenumbersubgroup,
fact_casedetails.casetype,
fact_casedetails.township,
fact_casedetails.casestatus,
fact_casedetails.caseopendateid,
fact_casedetails.referredtolegalflag,
fact_casedetails.macinitiatedflag,
fact_casedetails.conversionstatusdesc,
fact_casedetails.assignedstaff,
fact_casedetails.completedstaff,
fact_casedetails.closedbystaff,
fact_casedetails.initiator,
fact_casedetails.reasonforinvestigation,
fact_casedetails.primaryaddress,
fact_casedetails.parcelnumber,
fact_highweedsandgrassdetails.vendormoweddatetime,
Cast(Datediff([day],
fact_highweedsandgrassdetails.receiveddatetime,
COALESCE (
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.recordimportdatetime))
AS
NUMERIC(9, 2)),
Cast(Datediff([day],
fact_highweedsandgrassdetails.receiveddatetime,
COALESCE (
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.recordimportdatetime))
AS
NUMERIC(9, 2)),
Cast(Datediff([day],
fact_highweedsandgrassdetails.assignedtovendordate,
COALESCE (
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.recordimportdatetime))
AS
NUMERIC(9, 2)),
CASE
WHEN mowingstatus = 'Mowed'
OR mowingstatus = 'Closed' THEN 1
ELSE 0
END,
fact_highweedsandgrassdetails.recordimportdatetime,
fact_casedetails.macsiebelnumber,
fact_highweedsandgrassdetails.mowingduedate,
fact_highweedsandgrassdetails.vendormoweddate,
fact_highweedsandgrassdetails.lastfeeinvoicedate,
fact_highweedsandgrassdetails.investigationopendatetime,
fact_highweedsandgrassdetails.investigationopendate,
fact_highweedsandgrassdetails.investigationopendateid,
Cast(Datediff([day],
fact_highweedsandgrassdetails.investigationopendatetime,
CASE
WHEN
( vendormoweddatetime IS NOT NULL
AND vendormoweddatetime <=
fact_highweedsandgrassdetails.casecloseddate ) THEN
fact_highweedsandgrassdetails.vendormoweddatetime
ELSE
CASE
WHEN (
fact_highweedsandgrassdetails.casecloseddate
IS NOT NULL
AND
fact_highweedsandgrassdetails.casecloseddate <=
fact_highweedsandgrassdetails.recordimportdatetime )
THEN
fact_highweedsandgrassdetails.casecloseddate
ELSE
fact_highweedsandgrassdetails.recordimportdatetime
END
END) AS NUMERIC(9, 2)),
Cast(Datediff(ss,
fact_highweedsandgrassdetails.investigationopendatetime,
CASE
WHEN
COALESCE (vendormoweddatetime,
fact_highweedsandgrassdetails.casecloseddate) IS
NOT NULL THEN COALESCE (vendormoweddatetime,
fact_highweedsandgrassdetails.casecloseddate)
ELSE
CASE
WHEN
( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
AND fact_highweedsandgrassdetails.casecloseddate <=
fact_highweedsandgrassdetails.recordimportdatetime ) THEN
fact_highweedsandgrassdetails.casecloseddate
ELSE fact_highweedsandgrassdetails.recordimportdatetime
END
END) AS NUMERIC(18, 2)) * 60,
fact_casedetails.assigneddepartment,
COALESCE (fact_casedetails.assignedstaff, '[null]')
+ '/'
+ COALESCE (fact_casedetails.assigneddepartment, '[null]'),
fact_highweedsandgrassdetails.casecloseddate,
fact_highweedsandgrassdetails.receiveddatetime,
fact_highweedsandgrassdetails.assignedtovendordate,
fact_highweedsandgrassdetails.vendorinvoiceamount,
fact_highweedsandgrassdetails.invoicedstatusdate,
fact_highweedsandgrassdetails.complaint_source,
fact_highweedsandgrassdetails.inspection_result,
fact_highweedsandgrassdetails.reason_for_complaint,
fact_highweedsandgrassdetails.contractcompliancevendor,
fact_highweedsandgrassdetails.vendor_action,
fact_highweedsandgrassdetails.date_of_complaint_id,
fact_highweedsandgrassdetails.date_of_inspection_id,
CONVERT(INT, Replace(
Replace(fact_highweedsandgrassdetails.casenumber, 'HWG', 0)
, '-', 0)),
fact_highweedsandgrassdetails.maccomments,
dbo.dim_highweedscensustracts.b1_census_tract) AS
[High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS]
ORDER BY [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
ASC
SVI just counted the columns from the top:
1) compliancejoin, 2) mowingsector, 3) caseclosedflag, 4) casehasvendorinfo, 5) mowingstatus, 6) assignedtovendor.
I see now that your subject line talks about column 6, but you say column 5 in body of your original post.
I don't know anything about cubes, but apparently there is some mapping problem when you run it from SSAS. (I assume it is SSAS, a part of the product I'm entirely ignorant of.) I figured that if you had got tripped by the zero-based numbering, you
might be staring on the wrong column.
Erland Sommarskog, SQL Server MVP, [email protected] -
I have created the following trigger that fires instead of an UPDATE statement and copies the altered data over to an Audit table before proceeding with the requested UPDATE. After doing so, I wrote a simple UPDATE statement for testing:
UPDATE Products
SET ProductCode = 'XYZ 2014', ProductName = 'Special Edition Tamborine', ListPrice = 74.99, DiscountPercent = .5
WHERE ProductID = 28;
When I run this, I get the following message:
Msg 245, Level 16, State 1, Procedure Products_UPDATE, Line 14
Conversion failed when converting the varchar value 'X' to data type int.
Here is my trigger:
IF OBJECT_ID('Products_UPDATE') IS NOT NULL
DROP TRIGGER Products_UPDATE; -- LINE 14
GO
CREATE TRIGGER Products_UPDATE
ON Products
INSTEAD OF UPDATE
AS
DECLARE @ProductID int, @CategoryID int, @ProductCode varchar, @ProductName varchar,
@Description varchar, @ListPrice money, @DiscountPercent money, @DateUpdated datetime
BEGIN
SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
@ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
@DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
FROM deleted;
INSERT INTO ProductsAudit
VALUES (@ProductCode, @CategoryID, @ProductCode, @ProductName, @ListPrice,
@DiscountPercent, @DateUpdated);
SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
@ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
@DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
FROM inserted;
UPDATE Products
SET CategoryID = @CategoryID, ProductCode = @ProductCode,
ProductName = @ProductName, Description = @Description,
ListPrice = @ListPrice, DiscountPercent = @DiscountPercent
WHERE ProductID = (SELECT ProductID FROM inserted)
END
I am confused a bit by (1) the location of the error and (2) the reason. I have looked over my defined data types and they all match.
Could someone offer a second set of eyes on the above and perhaps guide me towards a solution?
Thank you.This is an issue in this trigger. It will work for single record updates alone. Also for your requirement you dont need a INSTEAD OF TRIGGER at all.
You just need this
IF OBJECT_ID('Products_UPDATE') IS NOT NULL
DROP TRIGGER Products_UPDATE;
GO
CREATE TRIGGER Products_UPDATE
ON Products
AFTER UPDATE
AS
BEGIN
INSERT INTO ProductsAudit
SELECT ProductID,
CategoryID,
ProductCode,
ProductName,
ListPrice,
DiscountPercent,
GetDate()
FROM deleted;
END
Now, in your original posted code there was a typo ie you repeated the column ProductCode twice
I think one should be ProductID which is why you got error due to data mismatch (ProductID is int and ProductName is varchar)
see below modified version of your original code
IF OBJECT_ID('Products_UPDATE') IS NOT NULL
DROP TRIGGER Products_UPDATE; -- LINE 14
GO
CREATE TRIGGER Products_UPDATE
ON Products
INSTEAD OF UPDATE
AS
DECLARE @ProductID int, @CategoryID int, @ProductCode varchar, @ProductName varchar,
@Description varchar, @ListPrice money, @DiscountPercent money, @DateUpdated datetime
BEGIN
SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
@ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
@DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
FROM deleted;
INSERT INTO ProductsAudit
VALUES (@ProductID, @CategoryID, @ProductCode, @ProductName, @ListPrice,
@DiscountPercent, @DateUpdated);
SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
@ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
@DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
FROM inserted;
UPDATE Products
SET CategoryID = @CategoryID, ProductCode = @ProductCode,
ProductName = @ProductName, Description = @Description,
ListPrice = @ListPrice, DiscountPercent = @DiscountPercent
WHERE ProductID = (SELECT ProductID FROM inserted)
END
I would prefer doing it as former way though
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Hello there, I am creating a database of all our companies press contacts. I would like to create a form that would act as the front end and feed the database which is obviously the back end. The database is in Access 2013. My question is to whether this is indeed possible?
This forum thread appears to point towards the problem.
Re: Unable to Switch Audio Sync Settings -
Realtime data for a flash game - how to access/handle/poll the back end.
Hi,
I'm about to start working on a game that will be played on multiple consoles simltaneously. The user input from each console will be fed into a server and would populate a database/external store. This needs to be a client/server architecture where the flash client (the game on the kiosk), works on real time data that it gets from the server. Keeping in mind the "real" time aspect of the gamelplay and that it would involve multiple users at a time, I'm not really sure of how to interface the database with AS. The back end will essentially be PHP/MYSQL driven and I was thinking of maybe using AMFPHP service calls. But would this be efficient for a real-time setup ? Also, the users of the game, can be playing it physically on a touch screen kiosk , on the web, on SMS all at the same time!!
There are aspects in the game design, where a character changes animation based on their input. For example: If a user is playing an auction game and if his bid is the lowest (at the time of bidding), his character might start jumping. I'm not sure how to access this real time information from the database so that I can use it in Flash succesfully for such a client/server based multiplayer game.
Please advice.
Thanks
smaira
Message was edited by: sameermairayou would use the urlloader class from flash to access your server-side php and your php will query your database.
-
Problem with MS-Access as Back-End Database
We are using MS-Acess as a back-end Database
when we are inserting some rows into that table all rows are inserting but the last inserting row statement , is not inserting into that table
please the following code
import java.sql.*;
public class insert
public static void main(String []arg)throws Exception
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:lrk");
Statement st=con.createStatement();
st.executeQuery("insert into std1 values (1,'lrk') ");
st.executeQuery("insert into std1 values (2,'ram') ");
st.executeQuery("insert into std1 values (3,'hai')");
st.executeQuery("insert into std1 values (4,'prasad') ");
st.executeQuery("insert into std1 values (5,'raj') ");
In this program Last Statement is not inserting into the table
so please clarify that how we need to do thisDid you try what I told you?
http://forum.java.sun.com/thread.jspa?threadID=684051 -
Hi, We recently started getting these errors a couple times a day. There are 12 of them in total. We also have exactly 12 subscriptions. Does this indicate some db issue causing all of these
to fail?
Alert subscription data source module encountered errors while running: Alert subscription data source module was unable to find alerts that match the subscription because of database errors.
The following error(s) were encountered:
Exception Message: ExecuteScalar requires an open and available Connection. The connection's current state is closed.
One or more workflows were affected by this.
Workflow name: Subscription8b108a3e_4e3d_4fd0_b67e_cbfc21cd10b8
Instance name: Alert Notification Subscription Server
Instance ID: {E07E3FAB-53BC-BC14-1634-5A6E949F9230}
Management group: A Company Management Group
Thanks LanceHi,
Do you have hotfixes applied?
http://blogs.technet.com/kevinholman/archive/2009/01/27/which-hotfixes-should-i-apply.aspx
Also, I found a relevant thread for your reference.
Alert subscription data source module encountered errors while running</u1:p>
http://social.technet.microsoft.com/Forums/systemcenter/en-US/50557249-7f97-4b67-9729-f7088202385b/alert-subscription-data-source-module-encountered-errors-while-running?forum=operationsmanagergeneral</u1:p>
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
We have been seeing this error in the Operations Manager Event Log for quite a while.
Alert subscription data source module was unable to find alerts that match the subscription because of database errors.
The following error(s) were encountered:
Exception Message: ExecuteScalar requires an open and available Connection. The connection's current state is closed.
One or more workflows were affected by this.
Workflow name: MMEA_1348391424
Instance name: aaa.bbb.com
Instance ID: {88AED57C-5627-0C0B-E5C1-A9176A7E64CD}
Management group: SCOMr2
I haven't been able to spot any network outage on the management servers, or the database servers to indicate a problem. It usually happens at night, and when I look at the health explorer, the entity is healthy.
Please would someone help me in finding the root cause of this issue and what can be done to avoid it.
There were no backups running when this alert was generated. As far as I'm aware, everything was idle.
I would appreciate any help.
KaranException Message: ExecuteScalar requires an open and available Connection. The connection's current state is closed.
Based on the Error it seems the below for me
1. Either SCOM is unable to connect to the operationsmanager / operationsmanagerDW for its transactions on subscriptions
2. Or the SMTP server which your SCOM is using to relay emails has closed the connection.
So my suggestion would be you check the above for issues.
Gautam.75801
There were no network hiccups that I can see. Minimal disk activity. I've looked for any signs of database load, and haven't seen anything that jumps out.
Emails were going through just fine. These alerts get emailed to me, and if the SMTP server is 'closed' SCOM is usually quite sensitive and alerts about that too. I've seen it.
KB -
Hi Experts,
How the data is stored in Info cube and DSO...in the back end what will happen???
I mean Cube contain Fact table and Dimension tables How the data will store and what will happen in the backend???
Regards,
Swetha.Hi,
Please check :
How is data stored in DSO and Infocube
InfoCubes are made up of a number of InfoObjects. All InfoObjects (characteristics and key figures) are available independent of the InfoCube. Characteristics refer to master data with their attributes and text descriptions.
An InfoCube consists of several InfoObjects and is structured according to the star schema. This means there is a (large) fact table that contains the key figures for the InfoCube, as well as several (smaller) dimension tables which surround it. The characteristics of the InfoCube are stored in these dimensions.
An InfoCube fact table only contains key figures, in contrast to a DataStore object, whose data part can also contain characteristics. The characteristics of an InfoCube are stored in its dimensions.
The dimensions and the fact table are linked to one another using abstract identification numbers (dimension IDs) which are contained in the key part of the particular database table. As a result, the key figures of the InfoCube relate to the characteristics of the dimension. The characteristics determine the granularity (the degree of detail) at which the key figures are stored in the InfoCube.
Characteristics that logically belong together (for example, district and area belong to the regional dimension) are grouped together in a dimension. By adhering to this design criterion, dimensions are to a large extent independent of each other, and dimension tables remain small with regards to data volume. This is beneficial in terms of performance. This InfoCube structure is optimized for data analysis.
The fact table and dimension tables are both relational database tables.
Characteristics refer to the master data with their attributes and text descriptions. All InfoObjects (characteristics with their master data as well as key figures) are available for all InfoCubes, unlike dimensions, which represent the specific organizational form of characteristics in one InfoCube.
http://help.sap.com/saphelp_nw04s/helpdata/en/4c/89dc37c7f2d67ae10000009b38f889/frameset.htm
Check the threads below:
Re: about Star Schema
Differences between Star Schema and extended Star Schem
What is the difference between Fact tables F & E?
Invalid characters erros
-Vikram -
Hello Community
I am considering Kerberos Authenication but there seems to be
2 kinds of Kerberos: constrained and unconstrained.
Since when creating Kerberos you are only offered things like "Negotiate\Kerberos"
Or "Negotiate" or "Setspn" the question is how do you create a constrained
or unconstrained Kerberos and since the back end has to match how do you
do you know whether the back end uses constrained or unconstrained Kerberos?
Thank you
ShabeautKerb is used for one of several scenarios:
- connecting SP to SQL databases, which provides assurances around the connection between the SP service accounts and the SQL service accounts
- connecting SP to external systems (such as SQL databases, which may be used by BCS, Excel, PerformancePoint, PowerPivot, etc).
Constrained Delegation is not necessary for SP to use Kerb when connecting to SQL. it IS necessary for SP to talk to external systems (since Constrained Delegation is also known as "Kerberos with protocol transition", since it's
transitioning a Claims based auth token to a kerberos based auth token).
The difference is a setting in AD's Delegation tab, for the service account that will be collecting the users' login (presumably the webapp), and for the service account that will be performing the double-hop (presumably the service apps)... in addition
to the kerb setting, you also need to specify EXACTLY which endpoints can be reached using the Kerb + CD... unconstrained delegation (the default) allows the Kerb token to be passed anywhere... constrained delegation only allows the Kerb token to be used
by the places you specify (in the delegation tab)... such as the SQL server that the PerformancePoint scorecards will be querying.
Links:
- Microsoft's Kerberos guide : http://www.microsoft.com/en-us/download/details.aspx?id=23176
- more links : http://www.sbrickey.com/Tech/Blog/Post/SharePoint_Troubleshooting_Kerberos_and_External_Data_from_Excel_Services
- some health analyzers to find problems and recommend solutions : http://sdssharepointlibrary.codeplex.com/releases/view/92022
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Strategic Data Systems - for all your SharePoint needs -
Changes to the Back-end....Bringing it on to the Front-end
Hello All,
I would like to know the means of reflecting the changes made to the back-end tables on to the front end. Say we've a departments table and an ADF UIX page displaying the data from it in the front-end... we make certain modifications to the back-end table.. Now how do I bring it on to the already existing front-end UIX page. Could anyone give me a solution for this. Thanks in advance.
Regards,
Arun.VHi,
If you have navigated to the employees from selected department (ie, all the employees on the page are from the same department) then you can just drag the department name onto the page to create the bindings and display the department name.
If you are going direct to empoyees in a read only table an easy solution is to create a business component based on a database view that joins the two tables and presents the employee details and the department name.
create or replace view emp_dept as
select e.emp_id,
e.emp_name,
d.dept_id,
d.dept_name
from emp e,
dept d
where e.dept_id = d.dept_id; If you want to edit an employee then create a view link to a ViewObject which represents just employees using the employee id. On the single record edit page use a message choice to translate the department id into the department name.
Brenden -
How to run a Concurrent Program from the back end?
Hi,
How to run a Concurrent Program from the back end?
Is it Possible to see that Concuurent Request id which we run from the back end, in the front end?
If yes, then Please Give reply how to write the code
Thanks in Advance,
Bharathi.SThis is documented in Chapter 20 of the Application Developers Guide http://download.oracle.com/docs/cd/B53825_03/current/acrobat/121devg.pdf. These MOS Docs also have some information available
221542.1 - Sample Code for FND_SUBMIT and FND_REQUEST API's
235359.1 - How to Launch Planning Data Pull MSCPDP using FND_REQUEST.SUBMIT_REQUEST
HTH
Srini -
How to fing out the details of PO item befor replicating to the back end.
Hi SRM Guru
We are working on the SRM 4.0 and extended classic scenario.
I want to see all the details which are send to the back end for creation of the purchase Order.
I will specify the steps I follow.
Create the SC( waiting for approval ) , Approver approves the SC then SC will be created in SRM and the replicated in the Back end .
I have tried to find out this through the external debugging
I have set the break points @ BBP_DOC_SAVE_BADI and BBP_DOC_CHANGE_BADI, CL_HANDLER ( Methods ), but I am not able to reach the point to the PO creation in SRM and its replication in the back end.
1 Does any one tell me the sequence of the badiu2019s coming?
2 How the PO gets replicated in the back end ?
which bapi(BAPI CREATEPO) is called ?
After which event this bapi called ?
Which data is passed for the creation of PO ?
3 where I will get the information on the structures/internal tables which are getting populated during the debugging.
With Regards
DSSU mean u want to know at runtime?
Get the output from ur proxy as a string, count the number of "<" characters and divide it by 2. :-P
Of course, you'll have to treat the header fields separately.
Regards,
Henrique. -
I did the back up as instructed... Installed a larger hard drive and followed the restore instructions... Now I get a white screen with a folder icon and blinking question mark. When trying to set startup with new drive I get a bless tool error... Help!!
If you have installed a new hard drive , you will need to have formatted it in Disk Utility correctly. This may explain your problem.
Boot into your 10.6 Install disk again at the top menubar > Utilities > select Disk utility and in there select your new hard drive, and select the tab Erase and choose to make the format as Mac OS Extended Journaled. When that is finished look in the main window to make sure that the partition map scheme says GUID Partition Table.
Now go to the Restore tab and reinstall from your backup. -
Help? Time Machine could not complete the back up due to iMacsparsebundle is already in use??? This is the error message I am getting now with my Time Capsule as the back up device. Any suggestions?
Pull the power cord from the back of the Time Capsule
Wait a few minutes
Push the power cord back into the back of the Time Capsule
See if the Time Capsule will back up now
If not, see #C12 in this document:
http://pondini.org/TM/Troubleshooting.html
Maybe you are looking for
-
Welcome to the online services board!
Welcome to the board dedicated to Nokia's internet-based services, previously known as Ovi. This section is meant for discussing the online services offered by Nokia which are not covered by another specific board, and includes NOkia Store and Nokia
-
iTunes, app store , iBooks store, etc won't load and I don't know why. Everything else works fine, and I've rebooted it. The problem is still there and I know I have a good Internet connection. Help please?
-
How to tell if Yosemite is clean install or upgrade from previous version
My brand new MacBook Pro arrived last week, with Yosemite already installed on it. Having issues with WiFi (after coming out of sleep mode, mbp keeps its self-assigned address rather than getting an address though DHCP or using its old address), I wa
-
Error when drill down with essbase hierarchy
Hi , I am displaying one bar chart with, one Ragged hierarchy dimension "Region" ( structure : total region - > India , US -> India south , US south -> chennai , California) and "revenue" (measure) . Sometime's the drill down is happening smoothly (r
-
JDeveloper Version 11.2.1.3.0 In My Application i have one main URL Invoked Bounded Task flow and i have declared few beans in Pageflowscope in Managed Beans section of Overview tab. in this main task flow i have dragged and dropped other task flows