C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

Concatenate two different datatype variable.


Posted Date: 04 Jul 2009      Posted By: sunilsoni      Member Level: Bronze     Points: 1   Responses: 5



how can Concatenate two different datatype variable.
Plz help.


thanks In Advance.






Responses

Author: ashok    04 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

declare @field1 int, @field2 varchar(10)
set @field1=100
set @field2='temp'

select cast(@field1 as nvarchar)+cast(@field2 as nvarchar)



Author: Krishnaveni    04 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

select convert(varchar(50),@value) + convert(varchar(50),@value1)


Author: Williams    05 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi



select cast([columnName1] as nvarchar)+cast([columnName2] as nvarchar) from [tableName]



Author: ketha    06 Jul 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

-- Concatenation With ','
select convert(varchar,ColumnName1)+','+convert(varchar,ColumnName2) From TableName



Author: Devendra    06 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Use cast or convert


Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Incoming tabular data stream (tds) remote procedure
Previous : How to set password for mysql
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use