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 2000 Forums
 SQL Server Development (2000)
 Incorrect syntax near '1'. [SQLSTATE 42000] (Error

Author  Topic 

viktor
Starting Member

6 Posts

Posted - 2009-02-17 : 18:38:00
I am receiving this message 6 times in one run, and it is ended with "The step succeeded". Doesn't happen every time, approximately every other execution. Does not affect the result.
Please help.

Thanks - Viktor

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-17 : 18:39:56
Please post the full error message as it got cut off in the subject for this topic.

Could you also post the code that produces the error?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

viktor
Starting Member

6 Posts

Posted - 2009-02-18 : 10:00:57
The full message is:
Executed as user: RACETRAC\SQLAdmin.
Line 1: Incorrect syntax near '1'. [SQLSTATE 42000] (Error 170) Line 1: Incorrect syntax near '1'. [SQLSTATE 42000] (Error 170) Line 1: Incorrect syntax near '1'. [SQLSTATE 42000] (Error 170) Line 1: Incorrect syntax near '1'. [SQLSTATE 42000] (Error 170) Line 1: Incorrect syntax near '1'. [SQLSTATE 42000] (Error 170) Line 1: Incorrect syntax near '1'. [SQLSTATE 42000] (Error 170). The step succeeded.


The code is rather big, and also is calling several stored procedures. What's strange, the error does not prevent the proc to complete successfully. Also, it doesn't happen every time.

Thanks - Viktor
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-18 : 10:05:34
seems like this is happening inside a conditional branch. what does procedure do basically? does it involve dynamic sql?
Go to Top of Page

viktor
Starting Member

6 Posts

Posted - 2009-02-18 : 10:20:46
The procedure retrieves data from a linked server, does some processing, and then inserts/updates on the "local" SQL Server 2000. It is doing this in a loop, i.e. it retrieves data from the linked server into a temp table, and then loops through its rows, building and executing dynamic SQL. The results are perfectly fine, and that's what bothers me most: Isn't it supposed to crash once a syntax error is encountered?

Viktor
Go to Top of Page

viktor
Starting Member

6 Posts

Posted - 2009-02-18 : 10:55:31
I forgot to tell that this proc is executed as a job, and the next step in the job looks like that:

SELECT TOP 1 message
FROM sysjobhistory
WHERE job_id = 'F8F8A443-14AB-4A50-AB71-5B951334C079' and
step_id = 1

and the message is what I've posted.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-18 : 11:58:47
quote:
Originally posted by viktor

The procedure retrieves data from a linked server, does some processing, and then inserts/updates on the "local" SQL Server 2000. It is doing this in a loop, i.e. it retrieves data from the linked server into a temp table, and then loops through its rows, building and executing dynamic SQL. The results are perfectly fine, and that's what bothers me most: Isn't it supposed to crash once a syntax error is encountered?

Viktor


we cant answer more on this without knowing whats the code inside the procedure.
Go to Top of Page

viktor
Starting Member

6 Posts

Posted - 2009-02-18 : 12:08:48
Sorry can't do this, it's against the company policy.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-18 : 12:34:08
Sorry we can't help you then. It's impossible to speculate as to what the issue is without seeing the code.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-02-19 : 01:49:28
quote:
Originally posted by viktor

Sorry can't do this, it's against the company policy.


So, asking for help or posting only the error message is not against company policy?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

viktor
Starting Member

6 Posts

Posted - 2009-02-19 : 12:47:45
The main procedure is 550 lines, it is calling some 5-6 other sps, etc. I don't think you have time/desire to parse such a monster, so I tried to present the core of the problem: How is that possible for the proc to get the error, and still keep running (it is SQL Server 2000, no try/catch).
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-19 : 13:26:58
It is impossible for us to speculate.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -