Multiple choice technology databases

How to find out no. of objects in a database.

  1. Sp_find

  2. select * from Sys.sysobjects

  3. select * from sys.dm_exec_objects

  4. Sp_helpobjects

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The sys.sysobjects system view contains one row for each object in the database, making it ideal for counting objects. While sys.objects is preferred in modern SQL Server versions, sys.sysobjects is also available. The other options are either invalid procedures or incorrect dynamic management views.