Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

float to string sql cast or convert

leave a comment »

If you directly use convert it gives you solution in terms of +e. But if we convert it to bigint first then it provide the correct conversion to string.

CONVERT(nvarchar,  CAST(floattoconvert as bigint))

You can use str function but you need to be careful as it appends 0 or space while converting the same. So it would be bit tricky to use str function.

Advertisements

Written by Manish

August 10, 2010 at 7:29 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: