如何在SSIS中将带逗号的字符串转换为十进制?
How to convert string with comma to decimal in SSIS?
我得到的字符串价格以逗号结尾,我必须把它变成十进制 (10,2)。
我试图将其转换为具有相同精度和比例的数字,但仍然给我错误的潜在数据丢失。
Error: 0xC02020C5 at Przychód, Data Conversion 2: Data conversion failed while converting column "pr_kwota" (46) to column "Copy of pr_kwota" (10). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
来自平面文件的数据(str 50)
我尝试做的事情:
您可能需要使用转换“派生列”而不是“数据转换”,问题可能出在 space 和逗号上,因此您可以在派生列转换中使用此函数:
(DT_NUMERIC,10,2)(REPLACE(REPLACE(pr_kwota," ",""),",","."))
我得到的字符串价格以逗号结尾,我必须把它变成十进制 (10,2)。
我试图将其转换为具有相同精度和比例的数字,但仍然给我错误的潜在数据丢失。
Error: 0xC02020C5 at Przychód, Data Conversion 2: Data conversion failed while converting column "pr_kwota" (46) to column "Copy of pr_kwota" (10). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
来自平面文件的数据(str 50)
我尝试做的事情:
您可能需要使用转换“派生列”而不是“数据转换”,问题可能出在 space 和逗号上,因此您可以在派生列转换中使用此函数:
(DT_NUMERIC,10,2)(REPLACE(REPLACE(pr_kwota," ",""),",","."))