Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Resolving a deadlock Expand / Collapse
Author
Message
Posted Wednesday, March 6, 2013 4:56 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 1:16 PM
Points: 107, Visits: 511
Why not combine not updating the time in DOB with this?

IF UPDATE(DOB)
BEGIN
UPDATE P
SET DOB = dbo.fn_ReplaceTimeInDate(i.DOB)
FROM dbo.Patient P INNER JOIN
inserted i ON
P.PatientID = i.PatientID
where i.DOB <> cast(convert(varchar,i.DOB,112) as datetime)

SET @error_var = @@ERROR

--Error checking
IF @error_var > 0
GOTO rollback_tran
END

Post #1427693
Posted Wednesday, March 6, 2013 5:09 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 4:15 PM
Points: 1,066, Visits: 410
Thanks!! That may be the best way to fix it. Or a variation at least.
Post #1427696
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse