Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL server equivalent of MySQL's "SHOW VARIABLES"

I need to retrieve some information from a SQL Server database.

For example, I'd like the number of authorized, the number of queries connections or others...

With a MySQL database, I can have it with this query:

SHOW VARIABLES;

This returns me a result like:

enter image description here

Is there an equivalent for SQL Server?

like image 342
Gildas Ross Avatar asked Jan 01 '26 12:01

Gildas Ross


2 Answers

sp_configure will show current configuration parameters. For other information, reffer to the appropriate catalog view or management view. Eg. sys.dm_exec_connections will show the number of connections, sys.dm_exec_requests will show the executing requests and so on and so forth.

like image 84
Remus Rusanu Avatar answered Jan 03 '26 08:01

Remus Rusanu


You can use sp_helpdb DATABASENAME. That will give you basic info about collation, version etc. Connection info is available under System Views (SSMS), but you can also execute sp_who2 and that will give you good info on who is currently connected.

like image 20
smoore4 Avatar answered Jan 03 '26 08:01

smoore4



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!