SPR_UpdateRegisterNameFromActivity
Posted: Fri Mar 03, 2017 12:09 am
Sets the name of a register from the attached activity to save entering in two places
Code: Select all
CREATE PROCEDURE [dbo].[SPR_UpdateRegisterNameFromActivity](@NumRecords int OUTPUT)
AS
BEGIN
SET NOCOUNT ON;
UPDATE R
SET R.r_name = A.a_name
FROM ulive.dbo.capd_register R
INNER JOIN ulive.dbo.capd_activity A
ON A.a_register = R.r_id
WHERE
R.r_name IS NULL
AND A.a_name IS NOT NULL
SET @NumRecords = @@ROWCOUNT
END