Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Process data with hidden characters

Author  Topic 

Trybbe
Starting Member

27 Posts

Posted - 2013-05-14 : 04:41:48
Hi I am having difficulties with hidden characters.

I have the following and need to transfer this data to a .txt file. The query after the union works fine but the first one just wont pass through to the destination. If I put the query in a variable I get an error that there is invalid characters in the data. Please assist this line definately has to be part of the output

SELECT
'Col1, ' + 'Col2, ' +'Col3, ' +'Col4' as col1
union
SELECT
CAST([Col1] AS CHAR(6)) +
CAST([Col2] AS CHAR(2)) +
CAST([Col3] AS CHAR(4)) +
convert(varchar(7),convert(decimal(18, 2), [Col4]))
FROM tabel1;

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-14 : 05:08:00
Whats the datatype? Try with unicode datatype and use supporting collation.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -