I have a problem with SQL rounding my decimals up when I pull them from a temp table that has the column set as VARCHAR. What is happening is I am pulling the info from a flat file but each column has "" around each field so I must make the temp table columns all VARCHAR so I may pull the info from the file properly. So after the info has been extracted, I run an update statement on the temp table to remove all quotes. Once this is done, the revised info is inserted into a staging table and any field that is a represented as a decimal is labled as such in the staging table.
What I am running into is when the info is inserted into the staging table, the decimals are rounded up to whole values. The column has been checked to verify that it is indeed a decimal. I even have a CAST statement in the insert hoping to combat the rounding issue, but it is not helping.
So what reason(s) would my decimals be rounding up?
Silly mistake.....The table definition in the staging table had the precision/scale at (18,0). I guess that is the default when you create a table through enterprise manage though I have never ran into this before when creating tables this way. Sorry for the stupidity.