Re: Enumerate SQL servers on net, create connection strings
- From: "William Vaughn \(MVP\)" <billva@xxxxxxxxxxxxxxx>
- Date: Sat, 25 Oct 2008 19:21:33 -0700
You don't need SMO. Use the .NET Factory classes to do this search the archives of this list for an example I posted some time ago drawn from an example in my book.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
"Bob" <Bob@xxxxxxxxxx> wrote in message news:u796g4lbn764vsgfunlq8urj4gacmc563n@xxxxxxxxxx
On Fri, 24 Oct 2008 12:50:52 -0500, "Gregory A. Beamer \(Cowboy\) -.
MVP" <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx> wrote:
You can feel out with DMO (COM) and SMO (not 100% sure about this, but I
would assume it has all of the discovery functionality of DMO).
Connection strings are fine, as long as you have a trusted connection. But,
without one, you would not be able to connect to the server anyway to use
DMO or SMO.
The connection strings you create will not necessarily work for end users,
however, as they must belong to a group that has rights.
Here is a link to SMO:
http://msdn.microsoft.com/en-us/library/ms162169.aspx
You can also find some info in SQL Server 2005/2008 BOL. There is also DMO
info in BOL.
Thanks for your reply, Gregory. I thought there would be a
'formulated' way to do this, as SMS is able to bring up a list.
I'm not a database-oriented programmer, but have to make use in a
project. One of the things I was puzzled by: There are several folders
inside the Program Files\Microsoft SQL Server folder, called MSSQL.1,
.2, etc. I'm told that they may be remnants from previous installs of
SQL server versions, but that sounds odd. These apparently map to
different 'virtual servers', one of which does -not- come up directly
in the SMS/Visual Studio connection menu. That particular one looks
like it maps to the connection string using (local).
This is the type of info that is difficult to find, perhaps because I
don't know appropriate search keys. Do you happen to know where I
could find info on how those folders are mapped?
Or even why the obvious (local) or its equivalent is not mapped to one
of the connections brought up in the SMS/Visual Studio menus? (IOW,
none of the DBs ref'd by the VS2008 connections has the data that was
stored via program using (local) in the connect string).
- Follow-Ups:
- References:
- Enumerate SQL servers on net, create connection strings
- From: Bob
- Re: Enumerate SQL servers on net, create connection strings
- From: Gregory A. Beamer \(Cowboy\) - MVP
- Re: Enumerate SQL servers on net, create connection strings
- From: Bob
- Enumerate SQL servers on net, create connection strings
- Prev by Date: Re: Fastest way to determine existence of record w given PK
- Next by Date: Re: Enumerate SQL servers on net, create connection strings
- Previous by thread: Re: Enumerate SQL servers on net, create connection strings
- Next by thread: Re: Enumerate SQL servers on net, create connection strings
- Index(es):
Relevant Pages
|