>>Yes, that's the way PRINT is handled. Try to replace PRINTs with
>>
>>RAISERROR( '.......' , 0, 1 ) WITH NOWAIT
>>
>
>Thanks, this works.
>
>But, the problem with that is that the + sign is not supported at that level to concatenate a portion of the date, for example.
You need to really check RAISEERROR syntax in BOL. + is not supported, you're right. I remember I had the same problem about 5+ years ago before.
DECLARE @DBNAME NVARCHAR(128);
SET @DBNAME = DB_NAME();
RAISERROR
(N'The current database ID is:%d, the database name is: %s.',
10,
1,
@DBID,
@DBNAME);
If it's not broken, fix it until it is.
My Blog