How can u get the number of pupils connecting the database?

Answer Posted / sreenivas

try this below query:

use <databasename>
go
select db_name(dbid) as db, count(dbid) as connections from sys.sysprocesses where dbid > 0 group by dbid

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you give me some DBCC command options?(Database consistency check) - DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage.

2035


List layers of abstraction microsoft architectured to provide relational db through cloud platform ?

161


How optimize sql query with multiple joins in sql server?

417


What does normalization do to data?

549


What is explicit mode in sql server?

536






Is it ok to shrink transaction log?

520


It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio

557


How to change the password of a login name in ms sql server?

563


What is mean by clustered index and non clustered index, give syntax of creation? : sql server database administration

594


Difference between connected and disconnected database in .net with sql server?

581


What are the types of database schema? : sql server analysis services, ssas

601


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

1576


Explain indexing and what are the advantages of it?

531


How to create new table with "create table" statements?

563


What are sql servers used for?

513