SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Process data with hidden characters
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Trybbe
Starting Member

South Africa
27 Posts

Posted - 05/14/2013 :  04:41:48  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 05/14/2013 :  05:08:00  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000