Board index » delphi » Using the print using convert Under SQL Server 6.5

Using the print using convert Under SQL Server 6.5

Hi - Sorry Never done this before

 I Am have some trouble with Print and convert under Sql Server 6.5 the @UID
is define as Integer or Int when I save the stored procedure I can not what
is wrong? Is my Convert function correct and why does it not like the +

 Print 'This is the New CaseNo Created from the server :'  +
CONVERT(Int,@UID)

 

Re:Using the print using convert Under SQL Server 6.5


Hi I was able to get this to work by using a @MessageString their might be a
better way but it works for what I want to do. THANKS

if exists (select * from sysobjects where id =
object_id('dbo.GenUniqueCaseID') and sysstat & 0xf = 4)
 drop procedure dbo.GenUniqueCaseID
GO
CREATE PROCEDURE GenUniqueCaseID
As
Begin

 Declare @UID Int
 Declare @MessageString VarChar(255)

 Print 'Stored Procedure - GENUNIQUECASEID'

 Begin Tran
 update SystemInfo
 set Last_Case_No = Last_Case_No + 1
 Select @UID = Last_Case_No
 From SystemInfo
 Commit Tran
 Select @MessageString = 'This is the New CaseNo Created from the server :'
+ CONVERT(Char(20),@UID)
 Print @MessageString

 Return @UID

End
GO

Frank H. Shaw <fs...@runestones.com> wrote in message
news:8dl0h5$cas12@bornews.borland.com...

Quote
> Hi - Sorry Never done this before

>  I Am have some trouble with Print and convert under Sql Server 6.5 the
@UID
> is define as Integer or Int when I save the stored procedure I can not
what
> is wrong? Is my Convert function correct and why does it not like the +

>  Print 'This is the New CaseNo Created from the server :'  +
> CONVERT(Int,@UID)

Re:Using the print using convert Under SQL Server 6.5


Hi Frank!

On Wed, 19 Apr 2000 16:12:43 -0400, "Frank H. Shaw"

Quote
<fs...@runestones.com> wrote:
>Hi I was able to get this to work by using a @MessageString their might be a
>better way but it works for what I want to do. THANKS

There is no better way. Print can not hold expressions, and
alternative is raiserror with parameters.

tomi.

Other Threads