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: Saturday, August 16, 2014 8:16 AM
Points: 107, Visits: 513
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: Monday, October 20, 2014 11:14 AM
Points: 1,069, Visits: 419
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