data type issue

  • Thread starter Thread starter NuB
  • Start date Start date
N

NuB

I have a C# program that is reading text files and uploading the data into
SQL.
The issue I'm noticing is that if i have money such as 1253.22 in the file,
is loading in the table as 1253.22 but when I run queyr analyzer the data
looks like this 1253.2201000020, why?

I'm passing the data item as a Double, but the column in the table is
defined as a float. so why is the data showing correctly in Enterprise
manager but not in query analyzer and how can I fix it so i shows as 1253.22
in enterprise manager and in query analyzer?
 
NuB,

Try changing the data type to "money" in SQL Server and use the decimal
data type in C#.

HTH

Jared
 
I have a C# program that is reading text files and uploading the data into
SQL.
The issue I'm noticing is that if i have money such as 1253.22 in the file,
is loading in the table as 1253.22 but when I run queyr analyzer the data
looks like this 1253.2201000020, why?

I'm passing the data item as a Double, but the column in the table is defined
as a float. so why is the data showing correctly in Enterprise manager but
not in query analyzer and how can I fix it so i shows as 1253.22 in
enterprise manager and in query analyzer?

see
http://www.yoda.arachsys.com/csharp/floatingpoint.html

Hans Kesting
 
if possible i would rather make the change in the code, since its a lot of
tables and alot of columns having this same issue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top