The T-SQL type Uniqueidentifier is not a formatting possibility for at RAISERROR
message. But converting the value to a string is a quick fix. This example is based on the Uniqueidentifier output from the procedure sp_add_jobschedule
.
DECLARE @_schedule_uid UNIQUEIDENTIFIER = N'7f6a5df0-a68f-4b07-992f-b7595958061f';
DECLARE @_schedule_code NVARCHAR(50) = CONVERT(NVARCHAR(50), @_schedule_uid);
RAISERROR ( N'Schedule UID = %s', 0,0, @_schedule_code ) WITH NOWAIT;
The output is then
Schedule UID = 7F6A5DF0-A68F-4B07-992F-B7595958061F
A small detail is that with the conversion the value is also converted to upper-case.
No comments:
Post a Comment