Hello,
i have the following problem:
i import a flat text file with DTS everything look wel but my comma disappears in the values in the SQL Table. The field is defined as FLOAT.
Someone any idea what's wrong?does your comma separate decimals from the significant digits?|||Originally posted by troj
Hello,
i have the following problem:
i import a flat text file with DTS everything look wel but my comma disappears in the values in the SQL Table. The field is defined as FLOAT.
Someone any idea what's wrong?
Nothing's wrong...although I'm suprised it didn't blow up...comma's in numbers are just a presentation issue...unlike precision...
But for example...you can't do..
CREATE TABLE myTablefloat (col1 float)
INSERT INTO myTablefloat(col1) SELECT 1,203.45
But for some reason in a text file it allows it|||Originally posted by ms_sql_dba
does your comma separate decimals from the significant digits?
it are money values, for example 10,22
in sql table it becomes 1022|||Originally posted by troj
it are money values, for example 10,22
in sql table it becomes 1022
What's the collation, language of your sql server box?
Sounds like it doesn't handle comma as precision.
Load the data in to a work table that the column defined as varchar..
Then populate your final table by doing an insert and convert your data..something like
SELECT CONVERT(float,REPLACE(col1,',','.'))|||If changing datatype is a problem you can even use the ActiveX replace function in the DTS transformation to replace "," by "."
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment