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 2012 Forums
 Transact-SQL (2012)
 Export flat file varchar(6000)

Author  Topic 

opan
Starting Member

4 Posts

Posted - 2013-04-23 : 03:12:35
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
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2013-04-23 : 08:20:23
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 - 2013-04-23 : 08:50:53
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
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-04-23 : 09:15:11
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 - 2013-04-23 : 09:29:27
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 - 2013-04-23 : 10:15:59
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
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-04-23 : 10:53:04
You are very welcome - glad to help.
Go to Top of Page
   

- Advertisement -