Home > Archive > Microsoft SQL Server forum > August 2005 > How to find Sql Server properties programatically









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to find Sql Server properties programatically
Verve

2005-08-24, 3:24 am

I am writing a program in .Net to retrieve properties of Sql Server.
How can I find the following properties without querying the database:

1. Replication enabled
2. Default language
3. Processors and threads running.

Thanks,
verve

Simon Hayes

2005-08-24, 7:24 am

You're probably looking for SQLDMO, which is a COM interface to MSSQL -
see Books Online for the details.

1. You can use the SQLDMO Replication object to enumerate replicated
databases, individual publications and articles etc.

2. Use the SQLServer.Language property

3. I'm not sure exactly what you want, but WMI might be a better option
for hardware and OS information. If by "threads" you really mean SQL
Server processes, then you can use the SQLServer.EnumProcesses method

In many cases, SQLDMO executes TSQL commands behind the scenes, so you
still need an authenticated connection to the server (and possibly a
user mapping in individual databases) to use it.

Simon

Verve

2005-08-24, 7:24 am

Hi,
Thanks for the prompt reply but can also tell me which classes I should
be querying in WMI or which interface?

Thanks in advance :)
Verve

Simon Hayes

2005-08-24, 7:24 am

The full WMI reference is on MSDN, but the technet scripting library
might be a faster way to get started:

http://www.microsoft.com/technet/sc...c/hwbavb03.mspx
http://www.microsoft.com/technet/sc...d/pcthvb07.mspx

Simon

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com