Specified cast is not valid
csco1550
Posts: 8
:shock:
When I test the log rescue, got this error message on one table / update
"Specified cast is not valid"
Please help.
Here is the table :
CREATE TABLE [WeeklySalesReport] (
[WeeklySalesReportGUID] [uniqueidentifier] NOT NULL CONSTRAINT [DF_WeeklySalesReport_WeeklySalesReportGUID] DEFAULT (convert(uniqueidentifier,(convert(binary(10),newid()) + convert(binary(6),getdate())))),
[dtCreated] [datetime] NOT NULL CONSTRAINT [DF_WeeklySalesReport_dtCreated] DEFAULT (getdate()),
[dtLastEdit] [datetime] NOT NULL CONSTRAINT [DF_WeeklySalesReport_dtLastEdit] DEFAULT (getdate()),
[SalesRepID] [int] NOT NULL ,
[LocationID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[SubmittedByID] [int] NOT NULL ,
[WeekEndingGUID] [uniqueidentifier] NOT NULL ,
[DollarsSold] [money] NOT NULL CONSTRAINT [DF_WeeklySalesReport_DollarsSold] DEFAULT (0),
[AccountsSold] [money] NOT NULL CONSTRAINT [DF_WeeklySalesReport_AccountsSold] DEFAULT (0),
[OnSiteVisits] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_OnSiteVisits] DEFAULT (0),
[Appointments] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_Appointments] DEFAULT (0),
[CallBacks] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_CallBacks] DEFAULT (0),
[TrialsPlaced] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_TrialsPlaced] DEFAULT (0),
[NewPresentations] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_NewPresentations] DEFAULT (0),
[PhoneHours] [float] NOT NULL CONSTRAINT [DF_WeeklySalesReport_PhoneHours] DEFAULT (0),
[Dialings] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_Dialings] DEFAULT (0),
[DecisionMakerContacts] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_DecisionMakerContacts] DEFAULT (0),
[AppointmentsScheduled] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_AppointmentsScheduled] DEFAULT (0),
[TargetContacts] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_TargetContacts] DEFAULT (0),
[TargetAppointments] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_TargetAppointments] DEFAULT (0),
[UninstalledBusiness] [money] NOT NULL CONSTRAINT [DF_WeeklySalesReport_UninstalledBusiness] DEFAULT (0),
[ActualDollarsSold] [money] NOT NULL CONSTRAINT [DF_WeeklySalesReport_ActualDollarsSold] DEFAULT (0),
[DaysWorked] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_DaysWorked] DEFAULT (5),
[NoActivity] [bit] NOT NULL CONSTRAINT [DF_WeeklySalesReport_NoActivity] DEFAULT (0),
[ISRReport] [bit] NOT NULL CONSTRAINT [DF_WeeklySalesReport_ISRReport] DEFAULT (0),
[wsr_dtWeekEnding] [datetime] NULL ,
[sum_UninstalledBusiness] [money] NOT NULL CONSTRAINT [DF_sum_UninstalledBusiness] DEFAULT (0),
[sum_amr_RouteRideDollarsSold_beforeStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_RouteRideDollarsSold_beforeStart] DEFAULT (0),
[sum_amr_RouteRideDollarsSold_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_RouteRideDollarsSold_afterStart] DEFAULT (0),
[sum_amr_RouteRideAccountsSold_beforeStart] [money] NOT NULL CONSTRAINT [DF_amr_RouteRideAccountsSold_beforeStart] DEFAULT (0),
[sum_amr_RouteRideAccountsSold_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_RouteRideAccountsSold_afterStart] DEFAULT (0),
[sum_amr_InstalledBusiness_beforeStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_InstalledBusiness_beforeStart] DEFAULT (0),
[sum_amr_InstalledBusiness_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_InstalledBusiness_afterStart] DEFAULT (0),
[sum_src_ActualDollarsSold_beforeStart] [money] NOT NULL CONSTRAINT [DF_sum_src_ActualDollarsSold_beforeStart] DEFAULT (0),
[sum_src_ActualDollarsSold_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_src_ActualDollarsSold_afterStart] DEFAULT (0),
[sum_amr_Adjustments_beforeStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_Adjustments_beforeStart] DEFAULT (0),
[sum_amr_Adjustments_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_Adjustments_afterStart] DEFAULT (0),
[sum_amr_MaySanis] [money] NOT NULL CONSTRAINT [DF_sum_amr_MaySanis] DEFAULT (0),
[sum_amr_MaySanisAdjustments] [money] NOT NULL CONSTRAINT [DF_sum_amr_MaySanisAdjustments] DEFAULT (0),
[flag_userSubmit] [bit] NOT NULL CONSTRAINT [DF_WeeklySalesReport_flag_userSubmit] DEFAULT (1),
CONSTRAINT [PK_WeeklySalesReport] PRIMARY KEY NONCLUSTERED
(
[WeeklySalesReportGUID]
) WITH FILLFACTOR = 90 ON [PRIMARY] ,
CONSTRAINT [FK_WeeklySalesReport_FiscalWeek] FOREIGN KEY
(
[WeekEndingGUID]
) REFERENCES [FiscalWeek] (
[FiscalWeekGUID]
),
CONSTRAINT [FK_WeeklySalesReport_users] FOREIGN KEY
(
[SalesRepID]
) REFERENCES [users] (
[userID]
),
CONSTRAINT [FK_WeeklySalesReport_users1] FOREIGN KEY
(
[SubmittedByID]
) REFERENCES [users] (
[userID]
)
) ON [PRIMARY]
GO
When I test the log rescue, got this error message on one table / update
"Specified cast is not valid"
Please help.
Here is the table :
CREATE TABLE [WeeklySalesReport] (
[WeeklySalesReportGUID] [uniqueidentifier] NOT NULL CONSTRAINT [DF_WeeklySalesReport_WeeklySalesReportGUID] DEFAULT (convert(uniqueidentifier,(convert(binary(10),newid()) + convert(binary(6),getdate())))),
[dtCreated] [datetime] NOT NULL CONSTRAINT [DF_WeeklySalesReport_dtCreated] DEFAULT (getdate()),
[dtLastEdit] [datetime] NOT NULL CONSTRAINT [DF_WeeklySalesReport_dtLastEdit] DEFAULT (getdate()),
[SalesRepID] [int] NOT NULL ,
[LocationID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[SubmittedByID] [int] NOT NULL ,
[WeekEndingGUID] [uniqueidentifier] NOT NULL ,
[DollarsSold] [money] NOT NULL CONSTRAINT [DF_WeeklySalesReport_DollarsSold] DEFAULT (0),
[AccountsSold] [money] NOT NULL CONSTRAINT [DF_WeeklySalesReport_AccountsSold] DEFAULT (0),
[OnSiteVisits] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_OnSiteVisits] DEFAULT (0),
[Appointments] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_Appointments] DEFAULT (0),
[CallBacks] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_CallBacks] DEFAULT (0),
[TrialsPlaced] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_TrialsPlaced] DEFAULT (0),
[NewPresentations] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_NewPresentations] DEFAULT (0),
[PhoneHours] [float] NOT NULL CONSTRAINT [DF_WeeklySalesReport_PhoneHours] DEFAULT (0),
[Dialings] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_Dialings] DEFAULT (0),
[DecisionMakerContacts] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_DecisionMakerContacts] DEFAULT (0),
[AppointmentsScheduled] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_AppointmentsScheduled] DEFAULT (0),
[TargetContacts] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_TargetContacts] DEFAULT (0),
[TargetAppointments] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_TargetAppointments] DEFAULT (0),
[UninstalledBusiness] [money] NOT NULL CONSTRAINT [DF_WeeklySalesReport_UninstalledBusiness] DEFAULT (0),
[ActualDollarsSold] [money] NOT NULL CONSTRAINT [DF_WeeklySalesReport_ActualDollarsSold] DEFAULT (0),
[DaysWorked] [int] NOT NULL CONSTRAINT [DF_WeeklySalesReport_DaysWorked] DEFAULT (5),
[NoActivity] [bit] NOT NULL CONSTRAINT [DF_WeeklySalesReport_NoActivity] DEFAULT (0),
[ISRReport] [bit] NOT NULL CONSTRAINT [DF_WeeklySalesReport_ISRReport] DEFAULT (0),
[wsr_dtWeekEnding] [datetime] NULL ,
[sum_UninstalledBusiness] [money] NOT NULL CONSTRAINT [DF_sum_UninstalledBusiness] DEFAULT (0),
[sum_amr_RouteRideDollarsSold_beforeStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_RouteRideDollarsSold_beforeStart] DEFAULT (0),
[sum_amr_RouteRideDollarsSold_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_RouteRideDollarsSold_afterStart] DEFAULT (0),
[sum_amr_RouteRideAccountsSold_beforeStart] [money] NOT NULL CONSTRAINT [DF_amr_RouteRideAccountsSold_beforeStart] DEFAULT (0),
[sum_amr_RouteRideAccountsSold_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_RouteRideAccountsSold_afterStart] DEFAULT (0),
[sum_amr_InstalledBusiness_beforeStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_InstalledBusiness_beforeStart] DEFAULT (0),
[sum_amr_InstalledBusiness_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_InstalledBusiness_afterStart] DEFAULT (0),
[sum_src_ActualDollarsSold_beforeStart] [money] NOT NULL CONSTRAINT [DF_sum_src_ActualDollarsSold_beforeStart] DEFAULT (0),
[sum_src_ActualDollarsSold_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_src_ActualDollarsSold_afterStart] DEFAULT (0),
[sum_amr_Adjustments_beforeStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_Adjustments_beforeStart] DEFAULT (0),
[sum_amr_Adjustments_afterStart] [money] NOT NULL CONSTRAINT [DF_sum_amr_Adjustments_afterStart] DEFAULT (0),
[sum_amr_MaySanis] [money] NOT NULL CONSTRAINT [DF_sum_amr_MaySanis] DEFAULT (0),
[sum_amr_MaySanisAdjustments] [money] NOT NULL CONSTRAINT [DF_sum_amr_MaySanisAdjustments] DEFAULT (0),
[flag_userSubmit] [bit] NOT NULL CONSTRAINT [DF_WeeklySalesReport_flag_userSubmit] DEFAULT (1),
CONSTRAINT [PK_WeeklySalesReport] PRIMARY KEY NONCLUSTERED
(
[WeeklySalesReportGUID]
) WITH FILLFACTOR = 90 ON [PRIMARY] ,
CONSTRAINT [FK_WeeklySalesReport_FiscalWeek] FOREIGN KEY
(
[WeekEndingGUID]
) REFERENCES [FiscalWeek] (
[FiscalWeekGUID]
),
CONSTRAINT [FK_WeeklySalesReport_users] FOREIGN KEY
(
[SalesRepID]
) REFERENCES [users] (
[userID]
),
CONSTRAINT [FK_WeeklySalesReport_users1] FOREIGN KEY
(
[SubmittedByID]
) REFERENCES [users] (
[userID]
)
) ON [PRIMARY]
GO
This discussion has been closed.
Comments
What is the query that Log Rescue is trying to run?
When I click it, I got the same error pop-up.
There are many updates on this table, all result same error when you click them.
BTW, those updates are generated by a nightly scheduled job.
I also noticed some of them are identified as user : DBO, some are identified as user: Unrecorded(-1).
I am pretty sure they are all updated by the job at 11:20PM.
Is there any way I can send you a screen shot?
Thanks.
Thanks.