• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enumerating SQL Server instances

 
jay akhawri
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to build an application which can enumerate MS SQL Servers in a LAN. There are few approaches in ODBC, and .Net which lets you do it. Such as SQLBrowseConnect (an ODBC API) and SMO, DMO etc.

however, i want to build such functionality without extensively spending my time through JNI --> ODBC/SMO(.Net)/DMO(COM) approach.

What could be other approaches?
Are there any impementation?

Regards,

~ Jay

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think this is possible without an MS API. Finding default instances could be done by brute force I suppose, but I don't know how you would go about finding named instances. The easiest approach (if you want to involve Java) is to call sqlcmd -L via ProcessBuilder and parse the output.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic