Back

Topic

[KB859]HOW PCVUE HANDLES SQL SERVER CONNECTIONS

Tags: HDS, SQL

9 years ago
By RM
Options
Print
Applies to:

All versions of PcVue


Summary:

How PcVue handles SQL Server connections.
Originator: LM


Details:

When you start a PcVue project which uses the HDS and SQL Server for archiving it opens three permanent connections to the SQL Server engine, one for read, one for write and one for maintenance.

Both read and write connections are opened by the SV application. The maintenance connection is opened by SQLDMO. (SQL Data Management Objects):

 sql connections

In addition to these permanent connections PcVue opens one temporary connection for each request to the database. These temporary connections are automatically closed after about a minute. Temporary connections are opened, for example, when:

  • You open a mimic containing a Log Viewer or when you refresh the data in a Log Viewer.
  • For each trace you display in a Trend Viewer operating in historical mode.
  • You open a mimic containing a Grid in historical mode.

Reminder: SQL Server EXPRESS edition is NOT limited by the number of concurrent connections to the database. But it is limited in terms of performance, RAM usage and database size.

 

 

Exemple SQL query to list connections:

CREATE TABLE [dbo].[CONNECTIONS]( [SPID] [int] NULL, [Status] [varchar](255) NULL, [Login] [varchar](255) NULL, [HostName] [varchar](255) NULL, [BlkBy] [varchar](255) NULL, [DBName] [varchar](255) NULL, [Command] [varchar](255) NULL, [CPUTime] [int] NULL, [DiskIO] [int] NULL, [LastBatch] [varchar](255) NULL, [ProgramName] [varchar](255) NULL, [SPID2] [int] NULL, [REQUESTID] [int] NULL)

ON [PRIMARY]

GO

INSERT INTO CONNECTIONS EXEC sp_who2

SELECT      *FROM        CONNECTIONS

— Add any filtering of the results here :

WHERE       DBName <> ‘master‘ AND DBName <> ‘msdb‘AND DBName <> ‘tempdb

— Add any sorting of the results here :ORDER BY    DBName ASC

DROP TABLE CONNECTIONS



 
 

Created on: 23 Feb 2017 Last update: 30 May 2024