Muhad Posted November 28, 2003 Posted November 28, 2003 The following code does work but when the stored procedure is called it takes about 10 seconds for it to load. I am not refering to the 30 minute wait before the name is deleted. Anyone have any ideas why the call would be so slow? SERVICE CODE conPubs = (New SqlConnection("Server=blah blah blah") cmdCommand = New SqlCommand("DeleteName", conPubs) cmdCommand.CommandType = CommandType.StoredProcedure cmdCommand.Parameters.Add("@Name", Name) cmdCommand.Parameters.Item(0).Value = Name conPubs.Open() cmdCommand.ExecuteNonQuery() conPubs.Close() STOREDPROCEDURE CODE Create Procedure[DeleteName] @Name varchar (30) As Begin Set NoCount On WaitFor Delay "00:30:00" Delete From NameTable Where Name = @Name End GO Quote
Moderators Robby Posted November 28, 2003 Moderators Posted November 28, 2003 Have you attempted the same thing without the 30 minute delay? Quote Visit...Bassic Software
Muhad Posted November 29, 2003 Author Posted November 29, 2003 Ok, I read in the Sql Server documentation that this is not the proper way to use 'waitfor'. I now use the Sql Server Agent to execute the Job. Works perfectly!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.