dbTalk Databases Forums  

Invalid length parameter passed to the substring function . . .error

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Invalid length parameter passed to the substring function . . .error in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DTShelp
 
Posts: n/a

Default Invalid length parameter passed to the substring function . . .error - 11-10-2003 , 03:52 PM






Hi,

I am new at DTS and was trying to do the following which
works when 100% I run it in Query Analyzer.

What I want to achieve is the following. I have several
tables that have product info like prices etc. I want to
export it into a csv file. I got it working as follows: -

I have a ExtractProd.sql file that I mentioned above that
works fine in Query Analyzer. What it does is extracts
from all the different tables info that I need and puts it
into another temporary table. (WORKS 100%)

I then use DTS to export the temporary table to a csv
file. This works 100%.

Now when I try and put the lines of ExtractProd.sql
into "Execute SQL Task" in the DTS package that extracts
the info from Temp Table to CSV I get the foloowing
error :" Invalid length parameter passed to the substring
function" error. The SQL
statements are as follows :

"USE database
GO

EXEC StoreProcExpTableDrop
GO

EXEC StoreProcExpTableCREATE
GO

EXEC StoreProcExpGroup1
GO

EXEC StoreProcExpGroup2
GO

EXEC StoreProcExpGroup3
GO

EXEC StoreProcExpGroup4
GO

EXEC StoreProcExpGroup5
GO

EXEC StoreProcExpGroup6
GO

EXEC StoreProcExpGroup7
GO

EXEC StoreProcExpGroup8
GO

EXEC StoreProcExpGroup9
GO"

As I indicated these work file in Query Analyzer.

According to knowledge base article I need to download
Service pack to resolve the error, however I have the
latest service pack installed already.

Can someone please point out my mistake or even point me
in the right direction.

Thank you.

DTShelp.

Reply With Quote
  #2  
Old   
Jim Hughes
 
Posts: n/a

Default Re: Invalid length parameter passed to the substring function . . .error - 11-10-2003 , 09:19 PM






GO is only valid within QA.

It is used to separate statements.

It is not valid within Execute SQL Task

"DTShelp" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I am new at DTS and was trying to do the following which
works when 100% I run it in Query Analyzer.

What I want to achieve is the following. I have several
tables that have product info like prices etc. I want to
export it into a csv file. I got it working as follows: -

I have a ExtractProd.sql file that I mentioned above that
works fine in Query Analyzer. What it does is extracts
from all the different tables info that I need and puts it
into another temporary table. (WORKS 100%)

I then use DTS to export the temporary table to a csv
file. This works 100%.

Now when I try and put the lines of ExtractProd.sql
into "Execute SQL Task" in the DTS package that extracts
the info from Temp Table to CSV I get the foloowing
error :" Invalid length parameter passed to the substring
function" error. The SQL
statements are as follows :

"USE database
GO

EXEC StoreProcExpTableDrop
GO

EXEC StoreProcExpTableCREATE
GO

EXEC StoreProcExpGroup1
GO

EXEC StoreProcExpGroup2
GO

EXEC StoreProcExpGroup3
GO

EXEC StoreProcExpGroup4
GO

EXEC StoreProcExpGroup5
GO

EXEC StoreProcExpGroup6
GO

EXEC StoreProcExpGroup7
GO

EXEC StoreProcExpGroup8
GO

EXEC StoreProcExpGroup9
GO"

As I indicated these work file in Query Analyzer.

According to knowledge base article I need to download
Service pack to resolve the error, however I have the
latest service pack installed already.

Can someone please point out my mistake or even point me
in the right direction.

Thank you.

DTShelp.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.