SQL Server Runs Out Of Resources Or Is It My Client Application. Handle Count = 96k

Jul 20, 2005

SServer PC: Win SBS 2003 with 2.6 GHz processor and 1GB RAM
SQL Server 2000 v 2000.8.00.76 (sp3)
MS Office 2k3
MSJet ms04-014 (latest ost sp8)
MDAC v2.8 RTM
ADO 2.1

vb6.exe / ADO 2.0

I think this is a SQL Server/ADO problem as I have 2 applications with
same problem.


My access database uses a timer based function to insert records into
SQL Server using ADO and stored procedures. Access also uses DAO ,
Jet/ odbc to linked tables on SQL Server for many other tasks/forms.
All is well when Access 1st run but after a few hours or so the Access
app grinds to a halt.
Upon checking the task manager the mem usuage upto 160MB and handle
count upto 86,000 ! (cpu process % is low).

After the "Access Fail" if I stop/start access only, performance is
not returned, I have to stop/start SQL Server.It would seem that all
connections from this PC to SQL server are badly affected, it is not
tied to the client application that had the problem.

As I could not work out where the problem was I took the Access
functionality into a VB6 app, using ADO 2.0, thinking this should
simplify matters with Jet and ODBC out of the way.

I now have the same problem with the number of handles increasing with
every new timer based function.

* code snippet example *
If Not OpenConnection Then 'we have not been able to open a
connection to SQL server
Call procLog("Connection failed to SQL server")
Exit Function
End If

'gVar.cnnSQL is my public ADODB.Connection
Set cmdSQL = New ADODB.Command
With cmdSQL
.ActiveConnection = gVar.cnnSQL
.CommandText = "MyDB.dbo.insert_tblMyData"
.CommandType = adCmdStoredProc
.Execute RecordsAffected:=lngRecs, _
Parameters:=Array(lngID, dtDate,intCategory,
strNationality,strNotes,strName)


End With


* code snippet *


** After the "Access Fail" if I look at one of my clients, running the
same Access app on another PC, it seems normally responsive when using
one my bound forms to browse the data from same SQL Server **



Any ideas anyone ?

View 3 Replies


ADVERTISEMENT

VB6/SQL Server Application Runs Locally, But Not From Server

Jul 23, 2005

I have a VB6 SP6 MDAC 2.8 application talking to SQL Server 2000. Once I'veinstalled this application on my local machine I have been able to move the..exe file to a file server and it runs just fine from there for all my localusers. This is very handy for updating the application without having toreinstall it on each user's machine each time. They just use a shortcutpointing to the file server .exe fileMy problem has become that we have some users at remote locations that VPNinto our network who also want to use this application. When it's installedlocally on their machines, or even on file servers at their locations,everything works fine. However, when they run the .exe off of my fileserver the SQL Server connections times out on the initial connection openafter the default 30 seconds every time. Run from their own desktops orfile servers it connects within 2 seconds every time. This is on bothWindows 2000 and XP Pro machines. Even when I tell the shortcut to usetheir local drive for the working directory the same problem happens.This goes against everything I've seen with server-based files for 15 years.Once a file is loaded in the computer for execution, why does it matterwhere it came from? What "baggage" can an .exe file carry with it that willcause it to not execute when hosted on one server, but run just fine fromthe desktop or another, closer server? The only known difference is thatthe connection speed is much better when I run it locally here to that fileserver.Help.

View 2 Replies View Related

VB.net Application For Client-Server

Apr 16, 2007

Hi folks,
I have an application designed in vb.net and it needs to Communicate with MS SQL 2005 database which resids on SERVER and The applicaton needs to run from Client PCs... When i install the Application on Server itself it works fine.... But when i Install it on any of the client Pcs it gives me the following error....

Unable to install or run the application. The application requires that assembly Microsoft.sqlserver.ConnectionInfo version 9.0.242.0 be installed in Global Assembly Cache (GAC) First.

Any help guys ???

View 3 Replies View Related

Client/Server Application

Sep 12, 2007

hie,
have a question. what tool is available to develop client/server application with db as ms sql server? is it only visual studio.
for example: i was using oracle 9i db with 9i developer as a total package to build applications. very easy with creating update, delete or new forms.
is it possible with visual studio or am i missing something?
i need to feel comfortable since i know sql server but dont know what to use for developing application.
many thanks,
farouque

View 2 Replies View Related

Proc Runs Very Slow Only In Application

Oct 22, 2007

We are having issues w/ a stored proc call in our application. When I run the proc through a query window in Mgmt Studio, it comes back in .3 seconds. However, when the application runs the proc (w/ the same parameters), it takes 30 seconds for the proc to complete. When I run a trace with the proc call through Mgmt Studio, it says 4000 read, but through the app, it says 4 million reads. What is happening?? (app uses Hibernate 3.2/ Java 1.5/ JDBC)

Thanks.

View 9 Replies View Related

How To Set My ASP.NET Application To Access SQL Server 2005 Using Client's User Credentials?

Jan 29, 2007

Hi guys,I'm not sure if I'm just bad at googling but I can't seem to find a way to set an ASP.NET 2.0 web application to connect to SQL Server 2005 using the current client's user credentials. My web application is using Integrated Windows Authentication so its Page.User.Identity is set to a DOMAINusername value... I want to pass that to my connectionstring or have my connections pick up the identity automatically and use that Identity when accessing the db server.Oh and another thing, my IIS Application Pool is using a specific Identity itself, so I don't know if that might affect the above.Hope someone could help. 

View 2 Replies View Related

SQL Server 2012 :: Return Multiple Messages To Client Application?

Jun 9, 2014

I have a procedure where after processing, i am required to send multiple message to calling application.

For ex:

create procedure test as
(@a as int,
@b as int
@c as int )
/*
some transformations */
print 'variable a is' + @a;
print 'variable b is' + @b;
print 'variable c is' + @c;

I am only providing a sample of return messages, but in reality there a lot more messages where a string and a parameter value need to concatenated.Unfortunately print is not allowing to concatenate parameter value.I can use RaiseError, but these messages are not really any error messages.

i tried to concatenate all message and output it using OUT type parameter, but the length of all messages combined exceeds 10000 characters.

Is there any other alternate to send these messages out to application?

View 1 Replies View Related

Sqlservr.exe Handle Count Of 3,306,263

Feb 13, 2008

Hi,

I have asked this question on the MSDN forums
with no response as yet. Maybe you guys can
shed some light on this:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2826915&SiteID=1

We have an apparent File Handle leak occurring in our SQL server.
Last weekend the server ran out of non-paged pool space:

Event ID 2019 -The server was unable to allocate from the system
nonpaged pool because the pool was empty.

In the process monitor the sqlservr.exe process had Mem Usage
of 503,528KB and a handle count of 3,306,263 (!). Using poolmon
the highest usage of the non-paged pool was for the Muta tag, with
211,610,768 Bytes. Restarting the sql service fixes this
temporarily, but already we are back to 427,000 handles for
sqlservr.exe and climbing steadily at about 200,000 handles
per day.

Is there a fix for this?

Cheers,
Geoff

PS
We have:
Microsoft SQL Server 2005 - 9.00.3054.00 (Intel X86)
Mar 23 2007 16:28:52
Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition
on Windows NT 5.2 (Build 3790: Service Pack 2)
(Meaning Windows Server 2003 R2 SP2 :-) )

View 20 Replies View Related

ODBC Connection For Client Application To SQL Server 2005 Express Installed On Network Computer

May 5, 2006

Hi All,

I've developed an application that connects to a SQL Server 2005 Express database. I created a DSN to connect to the database through ODBC. Currently, I am testing locally and everything works fine.

I would now like to install my application on another workstation and connect remotely to the database located on my development machine.

The client workstation does not have SQL Server 2005 Express installed on it because I would just like my application to connect remotely by creating the DSN and using ODBC. What I'm missing here are the database drivers. The "SQL Natice Client" is not available on this client workstation. How can I deploy the necessary drivers with my installation file so that I may create the required DSN name using the SQL Native Client driver?

Thanks!

View 6 Replies View Related

SQL Server 2012 :: How To Update Master Count Column From Multi Thread Application

Sep 28, 2015

We have an application that runs Jobs, each of which affect ## number of child objects (usually around 1M). When a thread gets to 5000 updated child objects it bulk inserts into a table called ActionLog with the child Id and JobId.

When the job is complete a sproc SUMs the children from the ActionLog table:
select sum(id) from ACTIONLOG where JOBID = @JobId;

It then updates the Jobs table AffectedObjectCount column with the sum(*) from above.

Instead of writing to the ActionLog table and calculating the SUM at the end I would like to do this 'real time'. After the bulk insert I would like to update the AffectedObjectCount column with the number of rows that were just bulk inserted. I tried this in the past and ran into major contention issues. There are usually 20 threads running a job so there exists a lot of potential for deadlocks.

Is there a recommended way to handle updating one column on one row from multiple threads? What is the best practice for a counter like this?

View 0 Replies View Related

Package Execution Fails In Windows Service But Runs Fine As A Windows Application.

Jun 23, 2006

I am attempting to write a Windows service that watches a database for uploaded files to import. When a new file is found, the corresponding SSIS package is run from the file system with variables passed through. I started development as a Windows app and copied the functionality to a service.

The app runs fine. The service does not. I get a "Failure" each time a package is executed. Everything is identical behind the scenes with the obvious exceptions that OnStart and OnStop handlers are buttons in the app. I added a script task at the beginning of one of the SSIS packages to notify me that it is even running at all. It doesn't even hit that initial task.

Again, the app will run all packages just fine. The data is imported and the results return as "Success."

The following is the code executing the package. Any help is appreciated. I've been banging my head on this one for a few days now. (Is there a tag to format a code sample?)

Dim pkgLocation As String
Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult

pkgLocation = sPackageFolder & PackageName & ".dtsx"

pkg = app.LoadPackage(pkgLocation, Nothing)

Dim vars As Variables = pkg.Variables

vars("ImportId").Value = ImportId
vars("ProductionServer").Value = ProductionServer
vars("ProductionDatabase").Value = ProductionDatabase
vars("SourceFileName").Value = FileName
vars("SourceFilePath").Value = FilePath

pkgResults = pkg.Execute()

View 3 Replies View Related

Access A Database From A Client Application

Oct 18, 2006

Hi all...

I am writing a Windows Application which will be used by about 100 clients. (NT Authenticated)

The application is going to be used in a LAN enviroment. User who have access will download a VB.NET application from a web site.

Of course, I want to prevent any of the 100 users from using a tool such as Query Analysis or ODBC to connect directly to the database and modify data.

So, it appears the way to go is to the "Application Roles". For this to work, the application roll password has to be saved in the application to execute the sp_setapprole procedure.

Is there a way to secure this password? I am worried about a user somehow extracting the password from the application and connecting directly.

Am I on the right track here? Any ideas appreciated!

Thanks,

Forch

View 4 Replies View Related

Use Reportiing Services From Client Application ???

Dec 11, 2007

Dear all,

I need to develop fro my customer a WinForm application which will display a list of report name available fro my customer, who will be free to select the desire report to print.
For that I was previously using Crystal report but as now I am in an environment where report services is included and can be used I have decide to test it and see if it cover my customer need.

I have use reporting service in one of my customer project but by dircetly accessing it through the ReportServer default interface but never from a WinFrom application.

How can I implemented the connection to reporting service, accessing report template and have access to print function as well as export to different format in my application ?

Is there any step by step procedure somewhere ? could not found

thnaks for your help
regards
serge

View 6 Replies View Related

Converting An Application To SQL Native Client

Oct 19, 2007

I am currently modifying an existing application (which uses OLE DB Consumer Templates to access a remote SQL db) to utilize SQL Native Client instead. Does anyone have any experience making this change?
Am I correct in my assumption that all I have to do is:
change my included headers from 'sqloledb.h' to 'sqlncli.h'
and
change CLSID_SQLOLEDB to CLSID_SQLNCLI?
I am still including the 'atldbcli.h' header and therefore still using the OLE DB Consumer Templates.
Can I continue to use the Consumer Templates along with SQL Native Client?


View 4 Replies View Related

A Query Runs Fast In Query Analuser But Slow In APplication

Jul 23, 2005

I am able to run a query which runs FAst in QA but slow in theapplication.It takes about 16 m in QA but 1000 ms on theApplication.What I wanted to know is why would the query take a longtime in the application when it runs fast on SQL server?How should we try debugging it?Ajay

View 2 Replies View Related

Deploy Database Application To Client Computer?

Oct 1, 2015

I want to deploy my database application to my client's computer. My application uses SQL Server 2014. My client has to run that software on a single PC. I was looking to download a lightweight version of SQL Server that can fulfill my requirements, so when I was looking for SQL Server downloads, I saw these files there, which file should I use in my situation

Express 32BIT WoW64SQLEXPR32_x86_ENU.exe
Express 32BITSQLEXPR_x86_ENU.exe
Express 64BITSQLEXPR_x64_ENU.exe
ExpressAdv 32BITSQLEXPRADV_x86_ENU.exe
ExpressAdv 64BITSQLEXPRADV_x64_ENU.exe
ExpressAndTools 32BITSQLEXPRWT_x86_ENU.exe
ExpressAndTools 64BITSQLEXPRWT_x64_ENU.exe
LocalDB 32BITSqlLocalDB.msi
LocalDB 64BITSqlLocalDB.msi
MgmtStudio 32BITSQLManagementStudio_x86_ENU.exe
MgmtStudio 64BITSQLManagementStudio_x64_ENU.exe

View 7 Replies View Related

ReportBuilder.Application Will Not Work On Client On Network

Apr 10, 2006

PLATFORM VERSION INFO
Windows : 5.1.2600.131072 (Win32NT)
Common Language Runtime : 2.0.50727.42
System.Deployment.dll : 2.0.50727.42 (RTM.050727-4200)
mscorwks.dll : 2.0.50727.42 (RTM.050727-4200)
dfdll.dll : 2.0.50727.42 (RTM.050727-4200)
dfshim.dll : 2.0.50727.42 (RTM.050727-4200)

SOURCES
Deployment url : http://webdev.ci.lubbock.tx.us/ReportServer$SQL05/ReportBuilder/ReportBuilder.application

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://webdev.ci.lubbock.tx.us/ReportServer$SQL05/ReportBuilder/ReportBuilder.application resulted in exception. Following failure messages were detected:
+ Downloading http://webdev.ci.lubbock.tx.us/ReportServer$SQL05/ReportBuilder/ReportBuilder.application did not succeed.
+ The remote server returned an error: (401) Unauthorized.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [4/10/2006 11:34:29 AM] : Activation of http://webdev.ci.lubbock.tx.us/ReportServer$SQL05/ReportBuilder/ReportBuilder.application has started.

ERROR DETAILS
Following errors were detected during this operation.
* [4/10/2006 11:34:29 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://webdev.ci.lubbock.tx.us/ReportServer$SQL05/ReportBuilder/ReportBuilder.application did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- The remote server returned an error: (401) Unauthorized.
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

Does anyone know how that I can get the reportbuilder.application to run on a client on the network. It seems that if I have to remote into the actual server to get the report builder to work would be pointless for users on the network. I get the 401 Unauthorized all the time. Any comments would help.

Jordanb412

View 3 Replies View Related

Urgent - Client Application Database Choice

Oct 31, 2006

We have a small accounting application which is currently based using DBASE database. We need to change the DB and considering SQL Express. However, is some one can clarify following, it would be very helpful:

1) Application is used mostly by standalone non-technical users. There are cases where more than one user will need to connect to DB.

2) We need to ensure that user can not modify database outside of our application. This is needed to ensure database does not get currpted or passwords lost and then no one can open the database.

3) Installation needs to be simple without providing any options to users except where to install database or point to already installed DB in case its a network environment where 2-3 users can be working on the same database.

4) Application is usually installed on normal desktop machines. So, DB should not load the PC heavily.

Please advice if SQL Express is the right direction even with these constraints? What are the other alternatives? We are open to have a small consulting project as well with someone who can guide us through these issues. Email to contact is rkabra101@yahoo.com



rick

View 1 Replies View Related

How To Access Output (Inserted.ColName) From Client Application ?

Nov 6, 2006

I am using SQL Express 2005 and VB .net Express.

Question 1:

How can I get the result stored in Inserted.ColName (by Output clause of insert command). In the documentation (BOL) for SQL 2005, there is written "returned to the processing application for use" in Output clause (first paragraph).

Question 2:

How to store Inserted.ColName into local variable when insert command is running in stored procedure.:

View 8 Replies View Related

Where To Build Client Application For SQL 2005 Standard Edition

Jul 24, 2006

Hi,
I have a database working on SQL Server 2005 Standart Edition and i want to create a client windows form aplication.
My problem is where to do it? Im trying to use MS visual basic 2005 express edition but it doent support SQL Server 2005 Standart Edition, it only supports SQL 2005 express edition.
What should i do ?
And in the visual studio 2005 that comes with the package of SQL Server 2005 standart edition there is no project of a winodws form.
Please help

View 8 Replies View Related

SQL_SSMEE Failed And Trying To Repair While Lauching Our Mobile Client Application.

Jul 24, 2006



Event ID - 1001 and Event ID - 1004.

Source - MsiInstaller

Error Description for Event ID - 1001:

Detection of product '{8670F53C-8AD7-4F34-BDBA-17B38A18CB65}', feature 'SQL_SSMSEE' failed during request for component '{6EC5DFBD-F6B5-4F02-8432-BFB8B03562B8}'

Error Description for Event ID - 1004:

Detection of product '{8670F53C-8AD7-4F34-BDBA-17B38A18CB65}', feature 'SQL_SSMSEE', component '{180F515D-F56C-40DD-9D71-CC532EA8E286}' failed. The resource '' does not exist.

While opening our SAP Mobile Client Application, in the task manager MSIEXEC.EXE is running and trying to repair the application and this will cause our application to take time to lauch. In the Event viewer, whenever we try to lauch our application we are getting this event id's. Can you please kindly provide a solution for this msg.

Regards,

Thiyagarajan.R

View 1 Replies View Related

Installting Sqlserver 2005 On The Client Machine For Windows Application

Oct 24, 2006

Hi
I developed a windows application in Visual studio 2005 and the database is sqlexpress.
I wanted my application to run on another system.For that i have installed sqlexpress 2005 on that machine.But that machine doesn't show me any enterprise manager or query manager for sqlserver.
Is there any solution for this.

Thanks

View 3 Replies View Related

A Procedure Runs Slow As A Job But Runs Fast Executed In A Query Window

Apr 23, 2008

Performance issue.


I have a very complex Stored Procedure called by a Job that is Scheduled to run every night.
It's execution takes sometimes 1 or 2 hours and sometimes 7 hours or more.

So, if it is running for more than 4 hours I stop the Job and I run the procedure from a Query Window and it never takes more than 2 hours.

Can anyone help me identify the problem ? I want to run from the Job and not to worry about it.

Some more information:
- It is SQL 2000 Enterprise with SP4 in a Cluster (It happens the same way in any node).
- The SQL Server and SQL Agent services run using a Domain Account that have full Administrative access.
- When I connect to a Query Window I also use a Windows Account.

- There is no locks or process bloking or being blocked while the job is running.
- Using the Task Manager the processor activity is ok, no more than 30 % in any processor.

View 15 Replies View Related

SQL 2012 :: Connections Not Getting Closed By Client Application And Impact Feedback Request

Mar 31, 2014

I have been investigating the number of connections activeinactive to a certain database server and I have stumbled across an application which seems to not be clearing its database connections.For one instance of a client there was >70 sql connections which eventuated from the closing and reopening one 1 screen in the culprut app. Once the application was closed all of the connections are recycled but its evident that within the application itself it is not correctly reusing already existing open connections.

I have raised a point with the main programmer that we need to investigate more into how the application is managingot managing its ADO .NET connections to SQL.

I am starting with doing some reading here URL... and I was hoping to get some more information about the possible impact of excessive sql connections on the SQL Server itself. Our organization is quite lucky in that our SQl Servers are Overspecced given their workload, bearing that in mind I would like to dig a bit deeper to get some stats if I can to highlight the scope of the issue to the managementprogrammers.Our SQL server peaks at 6500 processes and a good 70% of those are due to this applications mis-management of its sql connections.

View 6 Replies View Related

Client Unable To Establish Connection Encryption Not Supported On SQL Server. (Microsoft SQL Native Client)

May 2, 2006

On Windows XP systems I get the following issue when trying to browse the MSDB folder in SSIS

Client unable to establish connection
Encryption not supported on SQL Server. (Microsoft SQL Native Client)

I have noticed another post where several others have noticed the same issue. It appears to only occur on Windows XP installations. Is there a workaround or fix for this?

View 2 Replies View Related

Stored Procedure Just Runs And Runs

Oct 9, 2001

I have a stored proceedure (which I will tag on at the end for those interested) which is taking at least 15 minutes to run when executed, but completes in 1 minute when the tsql statement is run in Query Analyser. Why is this?

I suspect that it may be connected to table indexing, but why then is this bypassed when QA is used?

Any advice appreciated.

Derek


************************************************** ***********************
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'dbo.sp_ValidateAIGL') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE dbo.sp_ValidateAIGL
GO

CREATE PROCEDURE dbo.sp_ValidateAIGL
@IGLPeriodIDInt,
@IGLProgramIDInt

AS
/* ************************************************** ************************
Name:sp_ValidateIGL
Author:CL
Date:19-Jan-2001
Notes:
************************************************** ************************ */

--SET NOCOUNT ON

DECLARE@TaxYearChar(5),
@FrequencyChar(1),
@PeriodNo Int,
@ProgramLogIDInt

SELECT@TaxYear = TaxYear,
@PeriodNo = PeriodNo,
@Frequency = Frequency
FROMtbl_IGLPeriods
WHEREIGLPeriodID = @IGLPeriodID

SELECT @ProgramLogID = (SELECT ProgramLogID FROM tbl_SYSProgramLogs WHERE IGLProgramID = @IGLProgramID AND IGLPeriodID = @IGLPeriodID)

CREATE TABLE #IGLErrors
(
KeyFieldChar(24),
ErrorIDInt,
DescriptionVarChar(255)
)

-- *** Global Non Program Specific Data Errors ***
-- CHECK - that there are records in the DEB_IGL_PAYROLL_OUTPUT file.....none and the routine failed...
IF NOT EXISTS(SELECT * FROM tbl_OUT_Payroll WHERE IGLProgramID = @IGLProgramID)
INSERT INTO #IGLErrors SELECT NULL, 100, 'No records were processed by the IGL run!'

SELECT * FROM #IGLErrors

-- CHECK - search for any records where the employee's EXPENSE_CODE is NULL
INSERT INTO #IGLErrors
SELECT DISTINCT
NULLIF(EmpNo, ''),
2,
'Employee "' + COALESCE(NULLIF(RTRIM(EmpNo), ''),
'<Missing Employee>') + '" (Organisation Unit - ' + COALESCE(RTRIM(OrgUnitCode),
'<No Organisation Unit>') + ') does not have a EXPENSE_CODE Code.'
FROM tbl_OUT_Payroll
WHERE NULLIF(ExpenseCode, '') IS NULL
ANDIGLProgramID = @IGLProgramID

SELECT * FROM #IGLErrors
-- CHECK - check that the BALANCE of DEBITs match the balance of CREDITs
IF (SELECT SUM(Cash) FROM tbl_OUT_Payroll WHERE IsCredit = 1 AND IGLProgramID = @IGLProgramID) <> (SELECT SUM(Cash) FROM tbl_OUT_Payroll WHERE IsCredit = 0 AND IGLProgramID = @IGLProgramID)
INSERT INTO #IGLErrors SELECT NULL, 3, 'The total cash value for DEBIT elements does not match the total cash for CREDIT elements.'

SELECT * FROM #IGLErrors
-- *** Program 1 and 2 errors ***
IF @IGLProgramID IN (1, 2)
BEGIN
-- CHECK - search for any records where the employee's COST_CENTRE is NULL
INSERT INTO #IGLErrors
SELECT DISTINCT
NULLIF(EmpNo, ''),
1,
'Employee "' + NULLIF(RTRIM(EmpNo), '') + '" (Organisation Unit = ' + RTRIM(OrgUnitCode) + ') does not have a COST_CENTRE Code.'
FROM tbl_OUT_Payroll
WHERE NULLIF(CostCenter, '') IS NULL
ANDIGLProgramID = @IGLProgramID

SELECT * FROM #IGLErrors

-- Check for EMPLOYEEs that were not transfered to the PAYROLL output (usually caused by missing ORG_UNITs or not picked up in
-- the DEB_VIEW_APPOINTEE view...)
INSERT INTO #IGLErrors
SELECT DISTINCT
EMP_NO,
11,
'Employee "' + RTRIM(EMP_NO) + '" was excluded from the summary. Check their Organisation Unit codes!'
FROM PSELive.dbo.COSTING_OUTPUT
WHERENOT EMP_NO IN (SELECT DISTINCT EmpNo FROM tbl_OUT_Payroll WHERE IGLProgramID = @IGLProgramID)
ANDPERIOD_NO = @PeriodNo
ANDTAX_YEAR = @TaxYear

SELECT * FROM #IGLErrors

-- Check that there are no ELEMENTS in the COSTING_OUTPUT table that don't exist in the tbl_IGLElements table
INSERT INTO #IGLErrors
SELECT DISTINCT
ELEMENT,
12,
'Element "' + RTRIM(ELEMENT) + '" does not exist in the IGL Interface Elements table!'
FROM PSELive.dbo.COSTING_OUTPUT
WHERE ELEMENT NOT IN
(
SELECT DISTINCT Element
FROM tbl_IGLElements
)
ANDPERIOD_NO = @PeriodNo

SELECT * FROM #IGLErrors

END

-- *** Add a error to indicate the number of errors ***
IF EXISTS (SELECT * FROM #IGLErrors)
INSERT INTO #IGLErrors
SELECT 0,
0,
'Warning, there are ' + CAST(Count(*) AS VarChar(5)) + ' recorded errors!'
FROM#IGLErrors

-- Transfer the records to the ErrorsLog table ready for the user to view...
DELETE FROM tbl_SYSErrorsLog
INSERT INTO tbl_SYSErrorsLog (IGLProgramID, OutputLogID, KeyField, ErrorID, Description)
SELECT@ProgramLogID,
@IGLPeriodID,
KeyField,
ErrorID,
Description
FROM #IGLErrors
ORDER BY ErrorID

DROP TABLE #IGLErrors

SELECT *
FROM tbl_SYSErrorsLog
ORDER BY ErrorID

--SET NOCOUNT OFF

GO
GRANT EXECUTE ON dbo.sp_ValidateAIGL TO Public
GO

View 2 Replies View Related

SQL Server Deadlock On Resources??

May 30, 2007

We've got a 3rd party application that periodically runs SQL commands throughout the day. We've been getting issues with this application showing a sql error:

Transaction (Process ID 71) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

In checking the processes on SQL Server, there were a lot, and process ID 71 was actually hitting a completely different database.

Is there a way to streamline how SQL Server handles processes, and what's the limit at any given time?

View 4 Replies View Related

SQL Server Express Learning Resources?

Jan 16, 2006

I am new to SQL Server 2005 Express, where can I find some tutorials on developing web applications with this product?
 
Thanks!
 
Mike

View 2 Replies View Related

SQL Server,SQL Server Agent,SQL Analysis Resources Failing In SQL 2005 Cluster

Aug 17, 2007

Hi.
I have installed an SQL 2005 Failover Cluster on a Two Node Active Passive Windows 2003 Cluster.If i am trying to failover from the Active node to the passive Node,The Sql Server,Sql Server Agent and SQL Analysis resources fail,However if i reset the passowrd in the services tab of the above three services on the pasive node,the resources come online.
Below is the brief of my setup
1.I have two Active directory domain controllers running Windows 2003 R2 Standard edition with SP2.
2.i have installed a Windows 2003 Two Node Active Passive Cluster as NODE1 and NODE2.
3.The Domain account used to install WIndows 2003 A/P Cluster is Clusteradmin.This account is the member of Administartors on the Domain as well as the Local Admin on NODE1 and NODE2.
4.SQL 2005 with SP2 is installed on both the Nodes as SQL 2005 Failover Cluster.The account used to install SQL 2005 is sqadmin.This account is the member of Administartors on the domain and the member of Local Admins on NODE1 and NODE2.
5.SLQ 2005 has four domain groups for 4 SQL Services.The Services are SQL Server,SQL Server Agent,SLQ Anaylisis Server and Full text Search.
6.Each of these servcie has a seperate service account created for them.All these service accounts areb the members of domain admin and the member of Local Admin on NODE1 and NODE2.
7.Each of these servcies is running under these servcie accounts in the Servcies tab in NODE1 and NODE2.
8.If i fail the resources from NODE1 to NODE2 ,The SQL Server,SQL Server Agent and SQL Anaylisis resources are failing.on going to the service tab of NODE 2 I reset the password for these services,the services come online.
10.The Cluster resources and MSDTC Resources are Failing over successfully.They are coming online successfully.
11,I have a problem with the SQL Server Resources,even if i failback to NODE1 from NODE2,the same resources are failing again.

Plz Advice.
Regards
Khalid

View 1 Replies View Related

Books/Online Resources For SQL Server 2005?

Jul 16, 2007

Could some body suggest some good books and online resources for:
1. T-SQL Intermediate level/Advanced
2. SQL Server 2005
Thanks a bunch
Csharplearner

View 1 Replies View Related

Deadlocked On Lock Resources. SQL Server 2000

Jun 27, 2007

Hi, i am getting this error when i am running a stored procedure.



Transaction (Process ID XXXX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.



i think so it is getting this error becasue it blocking it self at one point in the SP



DECLARE cty_Cursor CURSOR FOR
SELECT Country FROM TB_Country



declare @cty varchar(2)


OPEN cty_Cursor;
FETCH NEXT FROM cty_Cursor into @cty;
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC SP_DO_SOMETHING @cty
FETCH NEXT FROM cty_Cursor into @cty;
END;
CLOSE cty_Cursor;
DEALLOCATE cty_Cursor;





i think so it calls the SP then before SP finsih its working it calls it back from cursor with other argument.



how we can make it sure it finish it execution before it is being called again. i think so we need some sort of lock here but i am not able to find right solution . please anyone suggest something.



Regards,

Haroon

View 2 Replies View Related

Good Online Resources For Teaching SQL For SQL Server 2000

Oct 27, 2005

my freind asked me to look for him for online book or something very good that teach SQL for SQL server 2000 ... what i need is something like hands on examples that will take user from level 1 to level * .... i have seen alot of stuff in google but i think some of you might know what i need and can direct me to better resources as i could not find someting specail !!!

View 2 Replies View Related

Report Server Queue Not Fully Utilizing Resources

Mar 30, 2007

We've set up a report farm with two servers, both 64 bit with 4 CPUs each. One has 16Gig and the other 8Gig of memory. We're using Windows NLB and the load test software confirms that the NLB is working. When we run a number of concurrent reports, both servers get utilized, but they only work on a few at a time. The report server queue doesn't seem to be fully utilizing the hardware. From a prior post I've learned that the report server queue automatically runs 4 reports per CPU. This is not occuring for our setup. Has anyone else experienced the same? Are there any configurations that need to be set to open the queue up? The reports are heavy (300,000 records grouped and summed). Does this affect the queuing process?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved