Friday, March 30, 2012

RaiseError not getting what you what!!

Not PARSING "..." is this a BUG!!!!!

[ BEGIN
RAISERROR ('The employee is already in the list of overtime for this
date!..............................', 16,1)
RETURN -1
END
] = [ BEGIN
RAISERROR ('The employee is already in the list of overtime for this
date!', 16,1)
RETURN -1
END
]

============The script you posed is not a valid Transact-SQL. It is unclear to me what
you are trying to accomplish but below is an example.

CREATE PROC CheckOvertime
@.EmployeeId int,
@.OvertimeDate smalldatetime
AS
IF EXISTS
(
SELECT *
FROM OverTime
WHERE EmployeeID = @.EmployeeId AND
OvertimeDate = @.OvertimeDate
)
BEGIN
RAISERROR ('The employee is already in the list of overtime for this>
date!..............................', 16,1)
RETURN -1
END
GO

--
Hope this helps.

Dan Guzman
SQL Server MVP

<squirrelv5@.yahoo.com> wrote in message
news:1102408111.648976.196080@.z14g2000cwz.googlegr oups.com...
> Not PARSING "..." is this a BUG!!!!!
> [ BEGIN
> RAISERROR ('The employee is already in the list of overtime for this
> date!..............................', 16,1)
> RETURN -1
> END
> ] = [ BEGIN
> RAISERROR ('The employee is already in the list of overtime for this
> date!', 16,1)
> RETURN -1
> END
> ]
> ============

No comments:

Post a Comment