MS SQL Query to list all active connections to all DBs on a given SQl instance

Query: To List all active connections to all DBs on given SQL instance SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections, loginame as LoginName FROM sys.sysprocesses WHERE dbid > 0GROUP BY dbid, loginame Results: DatabaseName NoOfConnections LoginName Db01 2 NT AUTHORITYSYSTEM Db02 1 NT AUTHORITYSYSTEM master 16 sa QADB01 1 Testadmin-user Query: To List all active connections to specific DB on given SQL instance SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections, loginame as LoginName FROM sys.sysprocesses WHERE (dbid > 0 AND db_name(dbid) like ‘%db0%’) GROUP BY dbid, loginame Results: DatabaseName NoOfConnections LoginName Db01 2 NT AUTHORITYSYSTEM Db02 1 NT AUTHORITYSYSTEM            

Read more

Sybase SQL Anywhere Network DataBase Server (dbsrv11.exe) usage

From reference: Sybase DocXchange Function Start a personal database server or network database server. Syntax { dbeng11 | dbsrv11 } [ server-options ] [ database-file [ database-options ] …] Server options Server option Description @data Reads in options from a configuration file or environment variable. See @data server option. -? Displays usage information. See -? server option. -b Runs in bulk operations mode. See -b server option. -c size Sets initial cache size. See -c server option. -ca 0 Disables dynamic cache sizing [Windows, Unix, Mac OS X]. See -ca server option. -cc { + | – } Collects information […]

Read more