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)
 Increase Variable Length

Author  Topic 

abhijaiswal.84
Starting Member

29 Posts

Posted - 2011-12-19 : 01:08:14
Hi,

In SSIS I used a "Data flow task" in this task I took flat file source (.csv file), Derived Column, Data Conversion and an OLEDB Destination.

Here I used a variable in "Derived Column" I need to enter the value of this variable in OLEDB Destination, each time the variable is get change some times length of value can be 2 or et cn be 20 or any thing else.

Now I want to change the length of variable in "Derived Column".

Can anyone help me to understand how can we change the length of the variable.



Abhishek

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-19 : 01:10:56
you can assign length dynamically. you need to fix the length at time of creation of column in derviced column. fix it to maximum length of data that it needs to handle.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-19 : 01:11:56
and you need to use cast operator for it. use

(DT_STR,<your length>,1252) for non unicode data
or (DT_WSTR,<your length>) if its unicode

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

abhijaiswal.84
Starting Member

29 Posts

Posted - 2011-12-19 : 01:58:14
Hi Visakh,

Thank you so much for your help, its working now.

Abhishek
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-19 : 02:44:15
wc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -