issue with floating point when importing flat file comma separated SQL Server 2008
I have an issue while importing this dataset.txt (flat file, comma separated)in SQL Server 2008
x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25
0.438,0.498,3.625,3.645,5.000,2.918,5.000,2.351,2.332,2.643,1.698,1.687,1.698,1.717,1.744,0.593,0.502,0.493,0.504,0.445,0.431,0.444,0.440,0.429,1.0
0.438,0.498,3.625,3.648,5.000,2.918,5.000,2.637,2.332,2.649,1.695,1.687,1.695,1.720,1.744,0.592,0.502,0.493,0.504,0.449,0.431,0.444,0.443,0.429,1.0
0.438,0.498,3.625,3.629,5.000,2.918,5.000,2.637,2.334,2.643,1.696,1.687,1.695,1.717,1.744,0.593,0.502,0.493,0.504,0.449,0.431,0.444,0.446,0.429,1.0
0.437,0.501,3.625,3.626,5.000,2.918,5.000,2.353,2.334,2.642,1.730,1.687,1.695,1.717,1.744,0.593,0.502,0.493,0.504,0.449,0.431,0.444,0.444,0.429,1.0
0.438,0.498,3.626,3.629,5.000,2.918,5.000,2.640,2.334,2.639,1.696,1.687,1.695,1.717,1.744,0.592,0.502,0.493,0.504,0.449,0.431,0.444,0.441,0.429,1.0
0.439,0.498,3.626,3.629,5.000,2.918,5.000,2.633,2.334,2.645,1.705,1.686,1.694,1.719,1.744,0.589,0.502,0.493,0.504,0.446,0.431,0.444,0.444,0.430,1.0
0.440,5.000,3.627,3.628,5.000,2.919,3.028,2.346,2.330,2.638,1.727,1.684,1.692,1.714,1.745,0.588,0.501,0.492,0.504,0.451,0.433,0.446,0.444,0.432,1.0
0.444,5.021,3.631,3.634,5.000,2.919,5.000,2.626,2.327,2.638,1.698,1.680,1.688,1.709,1.740,0.595,0.500,0.491,0.503,0.453,0.436,0.448,0.444,0.436,1.0
0.451,5.025,3.635,3.639,5.000,2.920,3.027,2.620,2.323,2.632,1.706,1.673,1.681,1.703,0.753,0.595,0.499,0.491,0.502,0.457,0.440,0.453,0.454,0.442,2.0
0.458,5.022,3.640,3.644,5.000,2.922,5.000,2.346,2.321,2.628,1.688,1.666,1.674,1.696,0.744,0.590,0.496,0.490,0.498,0.462,0.444,0.458,0.461,0.449,2.0
0.465,0.525,3.646,3.670,5.000,2.923,5.000,2.611,2.315,2.631,1.674,1.658,1.666,1.688,0.735,0.593,0.495,0.488,0.497,0.467,0.449,0.462,0.469,0.457,2.0
0.473,0.533,3.652,3.676,5.000,2.925,5.000,2.607,2.310,2.623,1.669,1.651,1.659,1.684,0.729,0.578,0.496,0.487,0.498,0.469,0.454,0.467,0.476,0.465,2.0
0.481,0.544,3.658,3.678,5.000,2.926,5.000,2.606,2.303,2.619,1.668,1.643,1.651,1.275,0.723,0.581,0.495,0.486,0.497,0.477,0.459,0.472,0.484,0.472,2.0
0.484,0.544,3.661,3.665,5.000,2.928,5.000,2.321,2.304,5.022,1.647,1.639,1.646,1.270,0.757,0.623,0.493,0.484,0.495,0.480,0.461,0.474,0.485,0.476,2.0
0.484,0.532,3.669,3.662,2.945,2.926,5.000,2.326,2.306,2.620,1.648,1.639,1.646,1.270,0.760,0.533,0.493,0.483,0.494,0.507,0.461,0.473,0.486,0.476,2.0
0.482,0.520,3.685,3.664,2.952,2.927,5.000,2.981,2.307,2.329,1.650,1.640,1.644,1.268,0.757,0.533,0.492,0.482,0.492,0.513,0.459,0.474,0.485,0.474,2.0
0.481,0.522,3.682,3.661,2.955,2.927,2.957,2.984,1.700,2.622,1.651,1.641,1.645,1.272,0.761,0.530,0.492,0.482,0.492,0.513,0.462,0.486,0.483,0.473,2.0
0.480,0.525,3.694,3.664,2.948,2.926,2.950,2.995,1.697,2.619,1.651,1.642,1.646,1.269,0.762,0.530,0.493,0.482,0.492,0.516,0.462,0.486,0.483,0.473,2.0
0.481,0.515,5.018,3.664,2.956,2.927,2开发者_Python百科.947,2.993,1.697,2.622,1.651,1.641,1.645,1.269,0.765,0.592,0.489,0.482,0.495,0.531,0.462,0.499,0.483,0.473,2.0
I put the procedure I am following:
So, if you can see, when selecting in SQL Server, the floating point desappears? Maybe I am doing something wrong, in the column type, I also tried real, but get the same result, Do i have to tell something else to SQL ?
One thing I did note is that you are doing something in Spanish not English. Do the Spanish use the , as the decimal separator (I know some countries do but don;t know which ones)?
In Advance options, could you set dataprecision/datascale and try it again? That might help. I'm not sure.
Change regional settings to USA and ensure decimal places . or , Change country too and select USA. Restart SQL Server Management and try it. It works for me in Spain!
精彩评论