What is an alternate way of Converting Integer value to Varchar other that Cast function?

 Posted by vishalneeraj-24503 on 12/18/2013 | Category: Sql Server Interview questions | Views: 2346 | Points: 40
Answer:

We can also Convert Integer value to Varchar with the help of Convert function.

For Example:-

Declare @Id Int = 123;


Select Convert(Varchar,@Id) as Id;

//OR

Select Convert(Varchar(3),@Id) as Id;


Output will be 123 for both queries.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response