473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Error in store procedure

Hi

I've the following SP:

-----------
CREATE PROCEDURE spServicios
@numero int,
@maxdif int,
@resultado int OUTPUT
AS
BEGIN
SET ROWCOUNT 1
UPDATE control SET registro = getdate()
WHERE (fecha >= getdate()
AND fecha < dateadd(mi, @maxdif, getdate())
AND clientes_codigo IN (SELECT
clientes_codigo FROM telefonos WHERE numero = @numero)
SELECT @resultado = @@rowcount
SET ROWCOUNT 0
END

SELECT @resultado
------------

But when I try to compile I get the message: Incorrect syntax near the
keyword 'SELECT'
Any idea ?

Thanks in advance

J


Jul 23 '05 #1
2 1285
WHERE numero = @numero)
should be
WHERE numero = @numero))

Jul 23 '05 #2
Javier (jl****@manresa.net) writes:
CREATE PROCEDURE spServicios
@numero int,
@maxdif int,
@resultado int OUTPUT
AS
BEGIN
SET ROWCOUNT 1
UPDATE control SET registro = getdate()
WHERE (fecha >= getdate()
AND fecha < dateadd(mi, @maxdif, getdate())
AND clientes_codigo IN (SELECT
clientes_codigo FROM telefonos WHERE numero = @numero)
SELECT @resultado = @@rowcount
SET ROWCOUNT 0
END

SELECT @resultado
------------

But when I try to compile I get the message: Incorrect syntax near the
keyword 'SELECT'


Count your parentheses.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: George | last post by:
HI , I am getting the below error while i compile a Store procedure which is my main store procedure and does the call to all other supporting stored procedure. Compartively its a large file...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: Leon Shaw | last post by:
Need help understanding? Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- Object must implement IConvertible....
5
by: Solel Software | last post by:
Hello, I am attempting to serialize an object for storage in a DB field and them deserialize it later on. I have managed to Serialize it using private string SerializeObject(object...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
6
by: c676228 | last post by:
Hi everyone, I wrote a store procedure that fetch one row data in the database based on the parameter value I entered. After I created the store procedure, the store procedure code looks like...
0
by: rxding | last post by:
Hello, Performance reason we need to move some of our code into database. Java Store Procedure is given the first choice. However, while investigating some sample code of Java store procedure, ...
5
by: Hardy Wang | last post by:
Hi all, I am migrating an old web application developed in .Net 1.1 to .Net 2.0. During my new development and testing, I had following error while executing an stored procedure. It worked fine in...
2
by: kya2 | last post by:
I am not able to create following store procedure. CREATE PROCEDURE DBSAMBA.InsertDeleteBatch(OUT norows INT ) RESULT SETS 1 LANGUAGE SQL BEGIN part1 DECLARE TOTAL_LEFT INT DEFAULT 0; ...
2
by: Ramchandra | last post by:
Hi, i am getting error while executing the store procedure db2 "CALL CRS.UPDATE_DEAD_RECORD2(')" SQL0444N Routine "*_RECORD2" (specific name "SQL080221165103852") is implemented with code in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.