473,396 Members | 2,017 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,396 software developers and data experts.

Corrupt Stored Procedure?

Hi all,
We have stored procedure, which basically strips a header and footer of
a table (first and last line). The procedure is written like so:

CREATE procedure stage.usp_StripSMMT
as

declare @count int
declare @smmt_count int
declare @check char(3)

select @count = (select count(*) from stage.smmt_test)

select @smmt_count = (select substring(linein, 76, 5) from
stage.smmt_test
where pk = @count)

if (@count - @smmt_count) = 2
begin
delete from stage.smmt_test where pk in (1, @count)
end

GO

Ever since I accidently over wrote this (with exactly the same
procedure!) its suddenly stopped working!?

Any ideas would be most gratefully received.
Sam
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
1 2627
Hi

In what way is it not working?

Is it that you have not granted permissions to run it?

Do you get non numeric values from
select substring(linein, 76, 5) from stage.smmt_test ?

Have you changed the ANSI_NULLS setting for the stored procedure?

You have not posted DDL and example data for the tables used. If pk is an
identity, the highest value will almost certainly not be the number of rows
in the table.

John

"Sam G" <mo**@spamhole.com> wrote in message
news:3f*********************@news.frii.net...
Hi all,
We have stored procedure, which basically strips a header and footer of
a table (first and last line). The procedure is written like so:

CREATE procedure stage.usp_StripSMMT
as

declare @count int
declare @smmt_count int
declare @check char(3)

select @count = (select count(*) from stage.smmt_test)

select @smmt_count = (select substring(linein, 76, 5) from
stage.smmt_test
where pk = @count)

if (@count - @smmt_count) = 2
begin
delete from stage.smmt_test where pk in (1, @count)
end

GO

Ever since I accidently over wrote this (with exactly the same
procedure!) its suddenly stopped working!?

Any ideas would be most gratefully received.
Sam
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #2

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

Similar topics

5
by: Jole | last post by:
Hi I'm writing a program that needs to read from a file. In order for the program to be robust, it should somehow check that the file isn't corrupt, or stuffed in any way. For example, that...
3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
4
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the...
8
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
4
by: dixie | last post by:
I have come across some code to walk through the records of a corrupt table and copy it record by record to a new table. It comes from the MVPS.Org site and is as follows. -----------------------...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
17
by: shineofleo | last post by:
Here is the situation: I wrote a VB programm, which stores all the information in a single Access database file using jet engine. It worked well, however one of my customs reported that there was...
2
by: DZanke | last post by:
When our developers access a MS SQL 2000 stored procedure using Visual Studio 2005, it seems to save the stored procs in a format that causes problems w/ MS SQL 2000. When I view the stored proc w/...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.