For example, I would like to rank the instances, 1. SQL Server 2005 2. SQL server 2000, 3. Sql express, 4. MSDE
So I would basically like to default to the best choice available locally for the user.
Is there any way to do this using SMO?
Thanks...
Hi Johnny,
Yes, you could:
DataTable dt;
dt = SmoApplication.EnumAvailableSqlServers("JohnnysServer");
for (int i = 0; i < dt.Rows.Count; i++)
{
MessageBox.Show( dt.Rows["Version"].ToString() );
}
Cheers,
Rob
Just a few questions about this...
I have tried running it on a few machines, and on some of them the version was null...do you know why this would happen?
Also, does this specific version differ for the fully blown versions vs the light (sql express/msde) versions? Because I noticed that they can have identical versions....
Thanks again...|||
Hi Johnny,
Yes, the versions will be the same, however the "Edition" property (from memory) will display the actual, well...edition. Have a browse of the datatable colums as there's a heap of properties/columns returned.
Not sure why version would be returned as null, unless of course the service wasn't running or otherwise unavailable.
Cheers,
Rob
No comments:
Post a Comment