Sunday, February 26, 2012

DTS load

New to SQL Server :(
load a txt file to SQL
there is a field, data type is numeric (13,6).
But in the file, it is like this: 9999999999999
How do I add the decimal points to make it: 9999999.999999??
Thanks a lotOriginally posted by qingbo
New to SQL Server :(

load a txt file to SQL

there is a field, data type is numeric (13,6).
But in the file, it is like this: 9999999999999

How do I add the decimal points to make it: 9999999.999999??

Thanks a lot

Add an Execute SQL Task object to the package and insert code something similar to this:

UPDATE tablename
SET ColumnName = ColumnName / 1000000.00

Where ColumnName is the numeric(13, 6) column defined in the table.

Hope this helps.

No comments:

Post a Comment