[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 580: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 636: sizeof(): Parameter must be an array or an object that implements Countable
Unofficial UNIT-e Forum • SPR_UpdateRegisterNameFromActivity
Page 1 of 1

SPR_UpdateRegisterNameFromActivity

Posted: Fri Mar 03, 2017 12:09 am
by robinwilson16
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