SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Timeout Expired
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbull
Starting Member

2 Posts

Posted - 06/25/2012 :  11:34:06  Show Profile  Reply with Quote
Hello, first of all I want to say I am at the end of my rope. So ANY helpful information is appreciated. I am familiar with SQL, but by no means proficient. With that being said, lets get into it.

So every day a user runs a Program in Access, this access database interacts with sql. However since 03/20 the program has failed constantly, always in the same place. Below I will show the vba, and the SQL side of things.
VBA side
'Mark new AR on list as new
                       'Took out code for non-existent AR
                       'If IsDate(txtLastDate.Value) Then
                       'DoCmd.RunSQL "UPDATE ADData SET ADData.New = True WHERE (((ADData.ADGroup) Not In (SELECT ADData.ADGroup FROM ADData WHERE (((ADData.Date)=#" & txtLastDate.Value & "#));)) AND ((ADData.Date)=#" & Cal.Value & "#) And ((ADData.SystemType)=""AR""));"
                       With cmd
                           .ActiveConnection = CurrentProject.Connection
                           .CommandText = "sp_ARUpdateNewAsNew"
                           .CommandType = adCmdStoredProc
                           'Parameters.refresh
                           .Parameters("@lastdate") = txtLastDate.Value
                           .Parameters("@cal") = Cal.Value
                       End With
                       cmd.Execute



The process fails on cmd.execute. I gives error "Run-Time error'2147217871' Timeout Expired.


Although the SQL statement is commented above, I am pulling this directly from the SQL management studio this is the Stored Procedure.
USE [Trouble_List]
GO
/****** Object:  StoredProcedure [dbo].[sp_ARUpdateNewAsNew]    Script Date: 06/25/2012 10:00:32 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[sp_ARUpdateNewAsNew](
@lastdate datetime,
@cal datetime
)
AS 


UPDATE    dbo.ADData
SET              New = 1
WHERE     (ADGroup NOT IN
                          (SELECT     ADData.ADGroup
                            FROM          ADData
                            WHERE      (((ADData.Date) = @LastDate)))) AND (Date = @Cal) AND (SystemType = 'AR') AND (Importing = 1)





What I find interesting is this process has been failing since 3/20. There was a database restore done on 3/19 at 3am. I find it interesting, but don't know if it is related.

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3328 Posts

Posted - 06/25/2012 :  11:48:00  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
How long dodes it take to fail?
Run the SP frrom management studio and see if it succeeds and how long it takes would probably be the first step.
Could be a lot of things causing the issue.
Next most likely I guess would be a permissions problem.

WOuld be surprised if this failure and the restore were not related. Maybe the restore was done because someone was doing something that failed and the result is a lost index or corrupt table.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

redbull
Starting Member

2 Posts

Posted - 06/25/2012 :  11:53:33  Show Profile  Reply with Quote
Alright, I will do that and relay my findings. I appreciate your time and help.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000