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:

Is there an equivalent for SQL Server?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With