Memo: Re: Help concatenating non string fields

Memo: Re: Help concatenating non string fields

 

  





Both these prints work :

declare @int1 int, @int2 int, @ch1 varchar(10), @ch2 varchar(10), @ch varchar(10)
set @int1 = 300
set @int2 = 5
set @ch = cast(@int1 as varchar(10))+cast(@int2 as varchar(10))
print @ch
set @ch1 = @int1
set @ch2 = @int2
set @ch = @ch1+@ch2
print @ch

************************************************************
HSBC Bank plc
Registered Office: 8 Canada Square, London E14 5HQ
Registered in England - Number 14259
Authorised and Regulated by the Financial Services Authority

Member of the HSBC Bank marketing group. We sell life assurance, pensions and collective investment schemes and advise only on our own range of these
products.
************************************************************



This E-mail is confidential.
It may also be legally privileged. If you are not the addressee you may not copy,
forward, disclose or use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the sender immediately
by return E-mail.

Internet communications cannot be guaranteed to be timely secure,
error or virus-free. The sender does not accept liability for any
errors or omissions.

MS Sql Server LazyDBA home page