Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 how Concatenating String works

Author  Topic 

vgunse@gmail.com
Starting Member

6 Posts

Posted - 2009-06-08 : 02:43:47
Hi,
I am new to sqlserver, Am i doing right here,

i tried as follows,
DECLARE @status varchar(100)
DECLARE @body varchar(5000)
SELECT @status =cast(0x59657300 AS varchar(10)) --0x59657300 is the hexadecimal value of string Yes
SET @body='This is the Status :'+@status
print @body

Now output will be:
This is the Status :Yes

so far good, if again i add some string on @body means it do not come
SET @body='This is the Status :'+@status+' finished'

Now expected output will be:
This is the Status :Yes finished

but output will be again:
This is the Status :Yes

How do i get expected result,please give me some idea

Thank you,

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-08 : 02:50:19
0x596573 is right
0x59657300 is not right


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

vgunse@gmail.com
Starting Member

6 Posts

Posted - 2009-06-08 : 04:37:15
Thanks a lot for info. Now i am doing well
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-08 : 04:42:39
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -