SQL Server Performance

Problem with split() in SQL2K DTS Task

Discussion in 'SQL Server DTS-Related Questions' started by johnb92882, Feb 10, 2004.

  1. johnb92882 New Member

    I have an ASP process that uses "Split()" - it works perfectly.<br />When I use the same code in a DTS Task, Split()'s arrays do not work.<br />Here is a sample record from my source data -<br />"AB04HC1250 216 216 216 0 9 000000" <br />Here's a sample of my code in ASP<br />-----------------------<br />if (asc(ch)=10) then<br />tSplit = Split(line, chr(9)) ....This works in DTS<br />tname = trim(tsplit(0)) ....This works in DTS<br />thigh = trim(tsplit(1)) ....This Fails in DTS but works in asp<br />tlow = trim(tsplit(2)) ....This Fails in DTS but works in asp<br />tclose = trim(tsplit(3)) ....This Fails in DTS but works in asp<br />tvolume = trim(tsplit(4)) ....This Fails in DTS but works in asp<br />toptin = trim(tsplit(5)) ....This Fails in DTS but works in asp<br />' This splits the first group<br />sym = Split ( tSplit (0), 0 ) ....This works in DTS<br />sym1=trim ( sym (0) ) ....This works in DTS<br />yr = mid(tname,3,2) ....This works in DTS<br />mo = mid(tname,5,1) ....This works in DTS<br />----------------------------<br />When I remove references to the arrays "trim(tsplit (1)) - trim(tsplit (5))" in DTS, I get<br />"AB,04,H,C,1250,,,,,," by using the "sym, yr, mo sub code.." (above)<br /><br />I'd appreciate any help on the problem above or use of Split() arrays in DTS???<br />(I'm using W2K/SP4 with SQL2K/SP4, and MSDC ver 2.<img src='/community/emoticons/emotion-11.gif' alt='8)' /><br />Thanks
  2. satya Moderator

    I feel you would get better reponse if you post in ASP forums.
    I believe this is an ongoing discussion on SQLTeam forums.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.

Share This Page