View Single Post

   
  #1 (permalink)  
Old 02-28-2008, 07:48 PM
Sam G
 
Posts: n/a
Default 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!
Reply With Quote