Monday, 12 August 2013

UpdateCommand only when at least one field has changed?

UpdateCommand only when at least one field has changed?

Is it possible to have the UpdateCommand fire only when one of the fields
has actually changed? One of the fields is a timestamp, and I don't want
the timestamp to be updated unless one of the fields values has actually
changed?
This is ASP front end, there's nothing relating to it in the CodeBehind.
Not sure if it matters but I'm using an Infragistics WebDataGrid control.
Here's the lines, let me know if you need more of them:
<asp:SqlDataSource ID="tblClaimRoster" runat="server"
ConnectionString="<%$ ConnectionStrings:RosterConnectionString %>"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT RosterID, [EE Name] AS EE_Name, [EEID], [Mgr
Name] AS Mgr_Name, [Adjustment trained] AS Adjustment_trained,
[Appeal trained] AS Appeal_trained, [ARGUS], [Auto Reversal] AS
Auto_Reversal, [CBH D G] AS CBH_D_G, [CBH Proclaim] AS
CBH_Proclaim, [CCE Tool Access] AS CCE_Tool_Access, [CCP], [CCR],
[Checks Rework] AS Checks_Rework, [Chiro Occ Phys Home] AS
Chiro_Occ_Phys_Home, [RA], [RDE], [Puerto Rico] AS Puerto_Rico,
[Speech Vision Therapy] AS Speech_Vision_Therapy, [Stop Loss Calc]
AS Stop_Loss_Calc, [Surg Anes] AS Surg_Anes, [Transplant], [Non
Standard Contracts] AS Non_Standard_Contracts, [One View] AS
One_View, [Pharmacy], [PMHS], [Post Pricing] AS Post_Pricing, [Pre
D] AS Pre_D, [Proclaim], [Lifesource], [Maternity], [Medicare
Hospital] AS Medicare_Hospital, [Medicaid], [Medicare Physician]
AS Medicare_Physician, [MSP], [Negative Balance] AS
Negative_Balance, [Foreign Claim] AS Foreign_Claim, [Hospital
Standard] AS Hospital_Standard, [iCare], [ILWU], [iSave], [iView],
[iTrack], [Correspondence trained] AS Correspondence_trained,
[Defined Care] AS Defined_Care, [Dental Dentacom] AS
Dental_Dentacom, [Dental Webster] AS Dental_Webster, [Dialysis],
[ECPP], [Virgin Islands] AS Virgin_Islands, [Facets], [cFunds],
[SAR], [Alliance], [MERPS], [Proclaim Green Screens] AS
Proclaim_Green_Screens, [tblclaimRoster_Status], [Skill 1] AS
Skill_1, [Skill 2] AS Skill_2, [Medicom], [CIGNA Claims] AS
CIGNA_Claims, [Effective date in current role] AS
Effective_date_in_current_role, [Time Stamp] AS Time_Stamp,
[MSDRG], [ALI], [Call Trained] AS Call_Trained, [Dedicated Acct
Taft Hartley] AS Dedicated_Acct_Taft_Hartley, [Dedicated Acct SOI]
AS Dedicated_Acct_SOI, [SANP], [Dedicated Acct J J] AS
Dedicated_Acct_J_J, [Xprtr], [VOB], [Hospital Non Standard] AS
Hospital_Non_Standard FROM [tblclaimRoster] ORDER BY [EE Name]
ASC"
UpdateCommand="UPDATE [tblclaimRoster] SET [EE Name] = @EE_Name,
[EEID] = @EEID, [Mgr Name] = @Mgr_Name, [Adjustment trained] =
@Adjustment_trained, [Appeal trained] = @Appeal_trained, [ARGUS] =
@ARGUS, [Auto Reversal] = @Auto_Reversal, [CBH D G] = @CBH_D_G,
[CBH Proclaim] = @CBH_Proclaim, [CCE Tool Access] =
@CCE_Tool_Access, [CCP] = @CCP, [CCR] = @CCR, [Checks Rework] =
@Checks_Rework, [Chiro Occ Phys Home] = @Chiro_Occ_Phys_Home, [RA]
= @RA, [RDE] = @RDE, [Puerto Rico] = @Puerto_Rico, [Speech Vision
Therapy] = @Speech_Vision_Therapy, [Stop Loss Calc] =
@Stop_Loss_Calc, [Surg Anes] = @Surg_Anes, [Transplant] =
@Transplant, [Non Standard Contracts] = @Non_Standard_Contracts,
[One View] = @One_View, [Pharmacy] = @Pharmacy, [PMHS] = @PMHS,
[Post Pricing] = @Post_Pricing, [Pre D] = @Pre_D, [Proclaim] =
@Proclaim, [Lifesource] = @Lifesource, [Maternity] = @Maternity,
[Medicare Hospital] = @Medicare_Hospital, [Medicaid] = @Medicaid,
[Medicare Physician] = @Medicare_Physician, [MSP] = @MSP,
[Negative Balance] = @Negative_Balance, [Foreign Claim] =
@Foreign_Claim, [Hospital Standard] = @Hospital_Standard, [iCare]
= @iCare, [ILWU] = @ILWU, [iSave] = @iSave, [iView] = @iView,
[iTrack] = @iTrack, [Correspondence trained] =
@Correspondence_trained, [Defined Care] = @Defined_Care, [Dental
Dentacom] = @Dental_Dentacom, [Dental Webster] = @Dental_Webster,
[Dialysis] = @Dialysis, [ECPP] = @ECPP, [Virgin Islands] =
@Virgin_Islands, [Facets] = @Facets, [cFunds] = @cFunds, [SAR] =
@SAR, [Alliance] = @Alliance, [MERPS] = @MERPS, [Proclaim Green
Screens] = @Proclaim_Green_Screens, [tblclaimRoster_Status] =
@tblclaimRoster_Status, [Skill 1] = @Skill_1, [Skill 2] =
@Skill_2, [Medicom] = @Medicom, [CIGNA Claims] = @CIGNA_Claims,
[Effective date in current role] =
@Effective_date_in_current_role, [Time Stamp] = GetDate(), [MSDRG]
= @MSDRG, [ALI] = @ALI, [Call Trained] = @Call_Trained, [Dedicated
Acct Taft Hartley] = @Dedicated_Acct_Taft_Hartley, [Dedicated Acct
SOI] = @Dedicated_Acct_SOI, [SANP] = @SANP, [Dedicated Acct J J] =
@Dedicated_Acct_J_J, [Xprtr] = @Xprtr, [VOB] = @VOB, [Hospital Non
Standard] = @Hospital_Non_Standard WHERE [RosterID] = @RosterID">
</asp:SqlDataSource>
Sorry for the extra-long list of fields, but the TimeStamp one is close to
the end.

No comments:

Post a Comment