SELECT ID, (convert(varchar(3), ID) +  ' - ' + Name) AS IDName FROM Person


HTH

Regards
Naweed


-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Eva Li
Sent: Monday, July 25, 2005 10:31 PM
To: [email protected]
Subject: [AspNetAnyQuestionIsOk] Convert integer to string in SQL query

Hello All,
 
I have a SQL stored procedure that reads data out. In the query,
I have some thing like:
 
     SELECT ID, (ID +  ' - ' + Name) AS IDName FROM Person
 
Here, ID is integer and name is of type varchar. My question:
 
    How can I convert ID to string and make IDName as string in this query?
 
Can any one help me with this?
 
Thanks!
 
Eva


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links



 








 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to