Convert value to string

I am selecting a number field and need to convert it to 'string' because I have an export function which doesnt work with large numbers, but if I convert to string it should work.

Select number
from table

?
AleksAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Daniel WilsonConnect With a Mentor Commented:
What database?  MS SQL Server?  MySQL?

Select cast(number as varchar(15)) from table;
0
 
AleksAuthor Commented:
it is MS SQL 2008

what if the number is larger ?   can I do varchar(150) for example ?
0
 
Daniel WilsonCommented:
Sure you can.  But ... do you really have 150 digits?
0
 
AleksAuthor Commented:
No ... was just saying :)  thx !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.