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 2012 Forums
 Transact-SQL (2012)
 Export flat file varchar(6000)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

opan
Starting Member

4 Posts

Posted - 04/23/2013 :  03:12:35  Show Profile  Reply with Quote
Hello,
I am trying to export to a flat file a column of varchar(6000).

Can someone help?

Thanks.

note: a left(4000) is the highest I can go.

MIK_2008
Flowing Fount of Yak Knowledge

Pakistan
1052 Posts

Posted - 04/23/2013 :  08:20:23  Show Profile  Reply with Quote
Is there any issue coming in while you're exporting the data to flat file? Or its just that you're looking for a solution as how to export it?

Cheers
MIK
Go to Top of Page

opan
Starting Member

4 Posts

Posted - 04/23/2013 :  08:50:53  Show Profile  Reply with Quote
quote:
Originally posted by opan

Hello,
I am trying to export to a flat file a column of varchar(6000).

Can someone help?

Thanks.

note: a left(4000) is the highest I can go.



Yes there is a reason, I already have a table with long text in it that I need to export. I am and would only be using a ssis to create the file.
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3649 Posts

Posted - 04/23/2013 :  09:15:11  Show Profile  Reply with Quote
You may be using DT_WSTR in SSIS. See if you can change that to DT_STR, which would then allow you a maximum of 8000. Since your source data is VARCHAR (rather than NVARCHAR), you don't need DT_WSTR.
Go to Top of Page

opan
Starting Member

4 Posts

Posted - 04/23/2013 :  09:29:27  Show Profile  Reply with Quote
Thank you James for your response.
I was using DT_WSTR and I used DT_TEXT and DT_STR,
in a data conversion.

Still have the same issue. Here is the error message:


Error 1 Validation error. Create csv file: Create csv file: The data type for "Flat File Destination.Inputs[Flat File Destination Input].Columns[myColumnName]" is DT_NTEXT, which is not supported with ANSI files. Use DT_TEXT instead and convert the data to DT_NTEXT using the data conversion component. Packagename.dtsx 0 0
Go to Top of Page

opan
Starting Member

4 Posts

Posted - 04/23/2013 :  10:15:59  Show Profile  Reply with Quote
Thank you for all your responses...

James, I went again to my data conversion and were able to view what columns were input/output and I saw that I still had DT_ntext,
so, I changed that to DT_text and hover over to make sure my input/output had the right data type.

So, Its working now... thank you.
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3649 Posts

Posted - 04/23/2013 :  10:53:04  Show Profile  Reply with Quote
You are very welcome - glad to help.
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.08 seconds. Powered By: Snitz Forums 2000