Convert Integer to String in SQL Server

Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 395
Suppose,we have a variable like below:-
DECLARE @i int
SET @i = 1234

Method 1 : Use CAST function
SELECT CAST(@i as varchar(10));

Method 2 : Use CONVERT function
SELECT CONVERT(varchar(10),@i);

Method 3 : Use STR function

Comments or Responses

Login to post response