Click here to Skip to main content
15,910,886 members
Home / Discussions / Database
   

Database

 
GeneralExport to XLS Pin
mosquitooth4-Jan-04 21:49
mosquitooth4-Jan-04 21:49 
GeneralRe: Export to XLS Pin
chinni16-Jan-09 23:24
chinni16-Jan-09 23:24 
Generalplease help me,my project......... Pin
Ahmed Gaser3-Jan-04 23:15
Ahmed Gaser3-Jan-04 23:15 
GeneralRe: please help me,my project......... Pin
preinsko6-Jan-04 18:55
preinsko6-Jan-04 18:55 
GeneralDELETE [table] gives syntax error Pin
Vaclav3-Jan-04 12:35
Vaclav3-Jan-04 12:35 
GeneralRe: DELETE [table] gives syntax error Pin
Guillermo Rivero3-Jan-04 17:45
Guillermo Rivero3-Jan-04 17:45 
GeneralRe: DELETE [table] gives syntax error Pin
winay7-Jan-04 2:08
winay7-Jan-04 2:08 
GeneralSql server stored procedure timing out problem Pin
pankajdaga1-Jan-04 10:51
pankajdaga1-Jan-04 10:51 
Hi,

I have a stored procedure problem. I have a C++ application that calls a stored procedure. However, many times the application just terminates as the stored procedure times out. It does not happen all the times, but quite frequently (~30%). It never happens when I run the stored procedure from the SQL server osql console app. I do not understand why it should time out. Any suggestions on this would be highly appreciated.

Here is the stored procedure:

--------------------------------------------------------------------
CREATE PROCEDURE DeleteTicketData
@ticketNum int AS

declare @testVorgangID int

-- delete errors
DELETE FROM TestVorgangEinleseFehler_T WHERE TicketNumber = @ticketNum

Select @testVorgangID = TestVorgangID from TestTickets_T WHERE TestTicketID = @ticketNum

IF (@testVorgangID IS NOT NULL)
BEGIN
declare @testID int
DELETE From TestVorgaenge_T where TestVorgangID = @testVorgangID
DECLARE tests_cursor CURSOR FOR
SELECT TestID FROM Tests_T WHERE TestVorgangID = @testVorgangID
Open tests_cursor
-- Perform the first fetch
FETCH NEXT FROM tests_cursor INTO @testID
-- as long as there are more rows to fetch.
WHILE @@FETCH_STATUS = 0
BEGIN
DELETE FROM TestAktionen_T Where TestID = @testID
DELETE FROM TestDSPACETable_T Where TestID = @testID
DELETE FROM TestEreignisse_T Where TestID = @testID
DELETE FROM TestZustaende_T Where TestID = @testID DELETE Tests_T WHERE CURRENT OF tests_cursor
FETCH NEXT FROM tests_cursor INTO @testID
END

CLOSE tests_cursor
DEALLOCATE tests_cursor
END
GO
--------------------------------------------------------------------

I am totally puzzled as to why it should time out some of the times. Any suggestions would be really appreciated.

Thanks Smile | :)

Sincerely,
Pankaj

Without struggle, there is no progress
GeneralRe: Sql server stored procedure timing out problem [modified] Pin
Marek Grzenkowicz2-Jan-04 5:19
Marek Grzenkowicz2-Jan-04 5:19 
GeneralRe: Sql server stored procedure timing out problem Pin
andyharman7-Jan-04 11:09
professionalandyharman7-Jan-04 11:09 
GeneralRe: Sql server stored procedure timing out problem Pin
pankajdaga15-Jan-04 2:05
pankajdaga15-Jan-04 2:05 
GeneralRe: Sql server stored procedure timing out problem Pin
Mike Dimmick8-Jan-04 5:59
Mike Dimmick8-Jan-04 5:59 
GeneralRe: Sql server stored procedure timing out problem Pin
pankajdaga15-Jan-04 1:40
pankajdaga15-Jan-04 1:40 
GeneralSQL to FOX Pin
Majid Shahabfar31-Dec-03 6:09
Majid Shahabfar31-Dec-03 6:09 
GeneralRe: SQL to FOX Pin
Mazdak31-Dec-03 19:06
Mazdak31-Dec-03 19:06 
GeneralRunning SQL in Developer Studio Pin
Steve Schaneville31-Dec-03 4:23
professionalSteve Schaneville31-Dec-03 4:23 
Generalopen UDL Dialog at runtime Pin
Itanium30-Dec-03 1:59
Itanium30-Dec-03 1:59 
GeneralRe: open UDL Dialog at runtime Pin
Mazdak31-Dec-03 19:26
Mazdak31-Dec-03 19:26 
GeneralRe: open UDL Dialog at runtime Pin
Itanium31-Dec-03 21:45
Itanium31-Dec-03 21:45 
GeneralRe: open UDL Dialog at runtime Pin
Mazdak31-Dec-03 22:01
Mazdak31-Dec-03 22:01 
GeneralRe: open UDL Dialog at runtime Pin
Heath Stewart3-Jan-04 18:49
protectorHeath Stewart3-Jan-04 18:49 
GeneralRe: open UDL Dialog at runtime Pin
Richard Deeming9-Jan-04 6:29
mveRichard Deeming9-Jan-04 6:29 
Generalstored procedures - avoiding recompilations [modified] Pin
Marek Grzenkowicz26-Dec-03 21:44
Marek Grzenkowicz26-Dec-03 21:44 
GeneralRe: stored procedures - avoiding recompilations Pin
Chris Meech5-Jan-04 4:57
Chris Meech5-Jan-04 4:57 
GeneralRe: stored procedures - avoiding recompilations [modified] Pin
Marek Grzenkowicz5-Jan-04 5:49
Marek Grzenkowicz5-Jan-04 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.