TSQL run fine in Query Analyzer But Not in DTS -
02-03-2004
, 01:45 PM
Hi,
I used DTS to move data into text. The TSQL codes ran
fine in QA. However when I put it in DTS package, it
truncated some of the fields. My codes contains a lot of
formating.
Ex:
Below query codes will truncate my other date fields
CONVERT(CHAR(12),
REPLICATE(' ', 4) +
SUBSTRING(CONVERT(CHAR(12),cert.[maturity],101),
1, 2) + SUBSTRING(CONVERT(CHAR(12),cert.[maturity],101),
4, 2) + SUBSTRING(CONVERT(CHAR(12),cert.[maturity],101),
7, 4)
) AS [Maturity Date],
CONVERT(CHAR(9), CAST(cert.[rate], DECIMAL(9,3) ) AS
[Interest Rate],
I change code to below:
CONVERT(CHAR(12),
REPLICATE(' ', 4) +
SUBSTRING(CONVERT(CHAR(12),cert.[maturity],101),
1, 2) + SUBSTRING(CONVERT(CHAR(12),cert.[maturity],101),
4, 2) + SUBSTRING(CONVERT(CHAR(12),cert.[maturity],101),
7, 4)
) AS [Maturity Date],
CONVERT(CHAR(9), cert.[rate] ) AS [Interest Rate],
Can anyone help me explain this,
Thanks in Advance,
Culam |