fnEmailNameIsOK
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @ContextIDExcluded | int | IN | |
| @RequestedName | nvarchar(100) | IN |
Definition
Copy
CREATE FUNCTION [dbo].[fnEmailNameIsOK]
(
@ContextIDExcluded int,
@RequestedName nvarchar(100)
)
RETURNS bit
AS
BEGIN
DECLARE @NameIsOK bit
SET @NameIsOK=1
/* Add ClientID to SELECT */
IF EXISTS (
SELECT TOP 1 [ID]
FROM [dbo].[Email]
WHERE [ID] <> @ContextIDExcluded AND [Name]=@RequestedName AND Deleted = 0
AND dbo.fnIsEmailLinked([ID]) = 1)
SET @NameIsOK=0
RETURN @NameIsOK
END