0
需要幫助的人。我正在嘗試使用以下查詢來獲取表中的數據。它在SSMS中工作,但在SSIS中引發錯誤。查詢適用於SSMS,但不適用於SSIS
SELECT CONVERT(VARCHAR(10), GETDATE(), 120) AS col1
UNION ALL
SELECT CAST (CustomerID AS VARCHAR)
FROM tCustomer
UNION ALL
SELECT CAST(COUNT(*) AS VARCHAR) AS col1
FROM tCustomer
引發錯誤
[OLE DB Source [1]] Error: There was an error with output column "col1" (35) on output "OLE DB Source Output" (11). The column status returned was: "The value could not be converted because of a potential loss of data.".
我所試圖實現的是
Header line yyyy-mm-dd
--e.g. 2013-07-01
Data records
Trailer record
---e.g. 13480
我要去哪裏錯了?
什麼數據類型(大小)目的列? – christiandev
長度爲20的字符串[DT_STR]。 – Akshay
任何記錄的長度是否大於20? – christiandev