FIX: Unable to Use GOTO in an Execute SQL Task of a DTS Package

Article translations Article translations
Article ID: 287401 - View products that this article applies to.
This article was previously published under Q287401
BUG #: 350933 (SHILOH_bug)
Bug #: 100831 (SPHINX)
Expand all | Collapse all


In an Execute SQL task for a Data Transformation Services (DTS) package, a GOTO statement may fail with the following syntax error when you try to parse the query or run the package:
Incorrect syntax near the keyword 'to'.


The token fetch incorrectly reads "go" instead of "goto", which ends the batch and triggers the syntax error.


To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack


Move the query to a stored procedure and execute the stored procedure from the Execute SQL task.


Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in SQL Server 2000 Service Pack 1.


Article ID: 287401 - Last Review: October 30, 2003 - Revision: 3.2
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 7.0 Standard Edition
kbbug kbfix kbsqlserv2000sp1fix KB287401

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from