473,379 Members | 1,260 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

SQLDMO Object

Hi,
how to create an SQL DMO object in .net and use it to enumerate the
properties of Sql server. Can we use this object to list properties
without logging in to the server?

Sep 8 '05 #1
3 2426
You can connect to a server like this in C#:

SQLDMO.SQLServer2 srv = new SQLDMO.SQLServer2();
srv.Name = "MyServer";
srv.LoginSecure = true;
srv.Connect(null,null,null);

Then you can access the various properties and methods - see Books
Online for the full SQLDMO object model. As I mentioned in reply to
your previous post, SQLDMO is executing TSQL behind the scenes, and it
requires an authenticated connection to the SQL Server for most
operations. An exception to this would be using something like the
Application.ListAvailableSQLServers() method, but for anything where
you're querying the properties of a specific instance, you will need to
log on to MSSQL.

Simon

Sep 8 '05 #2
That's what my problem is. I have to query some different machine with
different administrator. I can give a list of the properties that I
need to retrieve. For the rest I have found WMI classes:
1. Replication
With which servers
Publisher/Subscripto
2. Memory allocation (Dynamic or fixed)
How much is allocated
3. Memory allocated to SQL query
4. Maximum Concurrent User Connections
5. Startup parameters
6. Enabled Protocols (Named Pipes, TCPIP etc...)
7. Backup Service enable and details
8. DB Maintenance Plans
9. Log info (Date, Size, DB)
10. SQL Logins
11. Only need to gather the SQL specific login accounts
12. Linked Servers

Sep 8 '05 #3
You could get most of that information from SQLDMO (see the
Configuration, Registry, Replication and Login objects in the SQLDMO
hierarchy), but some of it isn't really clear - what do you mean by
"backup service", for example? Personally, I would seriously consider
buying a tool to do this, rather than reinvent something myself.

As for connecting to different servers, there's no way to get
information from any server without authenticating first, at the OS
level and/or the MSSQL level. I don't know anything about your
environment, but monitoring is a general systems issue, not an
MSSQL-specific one, so you might need to discuss it with your
manager/colleagues/client, to agree a general solution which allows
scripts and tools to connect to any server. You might create specific
domain accounts for monitoring purposes, for example.

Simon

Sep 8 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ewm | last post by:
Using InstallShield Developer 7.04. Does anyone know of a good way to detect if SQLDMO is installed? TIA mcpoo
1
by: Mohammed Abdel-Razzak | last post by:
Dear sirs I`ve used SQLDMO to make a backup to my database How can I use it to restore database? thanks Mohammed
3
by: T. | last post by:
I dumped VB and adopted C# for this version of Visual Studio. My problem! I am trying to reference an SQLDMO.Database object in C# like so: private SQLDMO.Database dbcurrent; private string...
1
by: C# beginner | last post by:
Hi all, I am using SQLDMO.Backup for backing up SQL server databases. I need to implement a progress bar to show the progress. I have some sample VB code that is like this: Dim WithEvents...
1
by: | last post by:
Hi all My requirement is to "on button_click, backup a SQL database using SQLDMO.Backup object and update the progress in a ProgressBar. The problem is the progress bar does not update at all...
2
by: | last post by:
Hi all, continued from yesterday's posting... I still haven't found a solution to this issue. I put a breakpoint in private void SqlBackupPercentComplete(string message, int Percent) {...
1
by: | last post by:
Hi all I am posting this to check if anyone could help me. The problem still persists. I am beginner in C#. Thanks. Subject: SQLDMO.Backup and ProgressBar - help please From: ...
1
by: T. | last post by:
I have this code: foreach(SQLDMO.Database db in sqlsvr.Databases) dblist.Add(db.Name.ToString()); When I run this code I get an error "Object reference not set to an instance of an object"....
6
by: Henry Padilla | last post by:
I am trying to use SQLDMO in C# and it's a nightmare. Any examples, suggestions, is there a different (managed) way to do this that I don't know about? Thanks for the help. Tom Padilla
0
by: Craig G | last post by:
i have a small application that uses the SQLDMO com object when i build a setup package to distribute it adds both the Interop.SQLDMO.dll assembly & sqldmo.dll File the problem is that the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.