spUpdateFriendlyURLsByRealmType
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@RealmType | int | IN | |
@PreviousPageID | int | IN | |
@NewPageID | int | IN |
Definition
Copy
CREATE PROCEDURE [dbo].[spUpdateFriendlyURLsByRealmType]
(
@RealmType int,
@PreviousPageID int,
@NewPageID int
)
AS
BEGIN
if @NewPageID <= 0
set @NewPageID = NULL
if @PreviousPageID <= 0 Or @PreviousPageID IS NULL
UPDATE VanityURl SET PageID = @NewPageID WHERE RealmTypeID = @RealmType AND PageID IS NULL
else
UPDATE VanityURl SET PageID = @NewPageID WHERE RealmTypeID = @RealmType AND PageID = @PreviousPageID
END