Link to home
Start Free TrialLog in
Avatar of healthcheckinc
healthcheckincFlag for United States of America

asked on

SSIS related question

I am trying to incorporate the script tasks in my package but I getthis error on this line of code

Row.OtherData.Split(";"c)

Its says that
'Split' is not a member of 'Microsoft.SqlServer.Dts.Pipeline.BlobColumn'

Not sure what to add to make this work?
Avatar of Reza Rad
Reza Rad
Flag of New Zealand image

you must read blob column data to string first,
like this:
Dim result As String = _
System.Text.Encoding.Unicode.GetString(Row.OtherData.GetBlobData(0, CInt(Row.OtherData.Length)))

and then use split function on this string
like this:
result.Split(";"c)


Avatar of healthcheckinc

ASKER

The reason I ask is that I put this in a data flow task yesterday and it had no problem. I tried to put it in my package today and it doesnt recognize the Split function. Do I still have to run the code above? Or can I add a reference or something?
I think YES .
because this error means that you have blob column and you can not apply string functions like split on it,
of course there maybe another way, and that is change column to other type like dt-str
can you take a look at this error. Im seeing the precompile binary code error alot with this. Im just wondering why it worked in the dtsx from yesterday and not here. Im thinkng its something minor. Plus the blob can take up alot of resources....Please see attcahed error
Error.doc
Where is the Blob column coming from? Is this still from a flat file?
Also, it looks like a task has been renamed with a '1' on the end of it. If you put the package out here we can look at it.
Thanks
yeah, I dont know if its a blob thing. Ijust have the squiggly line under Row.Split function on the script and when I hover over it it gives me that error. It also says something about the script cpmponent is configured to pre-compile the script but binary code is not found. Check out the error above
it's better to upload your full package here
Couple of things to check.
1. Is there a reason you have a Script Component AMOUNT 1? and not just Script Component AMOUNT?
2. In the Flat File Connection Manager for the Source file, the column OtherData is what DataType and Length. (Advanced Tab)
Thanks,
I changed the length and it cleared up the blob error. Now I get the error attached
Error.doc
An error like that, "VS_ISBROKEN", is almost always due to an object changed or missing. Open the Script Component and look for compile errors. Sometimes just opening the Script will provide you with an automatic fix.
But like rad said, if you upload the package we could probably help better.
HZ
ok here ya go
Package1.txt
anything???
Once I opened the package and changed the transfile to point to my copy of the source file, then I opened each Script Component, the Design Script window and then saved it. After that it ran for me.
If you still have issues, pass a long a screen shot of your Data Flow tab and open the Error List tab and send us the errors.
Thanks,
HZ
ok heres the problem. My fields are greater than DT_STR 8000. What would I use as my data type in my connection manager for OtherData? Other than DT_STR? Text? If so, how would I write that in the script? Would I have to use the Blob code?
ASKER CERTIFIED SOLUTION
Avatar of Steve Hogg
Steve Hogg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial