471,073 Members | 1,385 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Real newbie on SQL ....Know list database and table in SQL Server

26 16bit
I use this macro to list in A column of sheet the name of sql server on my lan.
Is possible to "scan server by server" and insert into column B the name of database and related table in column C, D, E, F...ecc...?

Sub test_sql()
Dim TEST As String
Dim RIGA As String

Set sqlApp = CreateObject("SQLDMO.Application")

Set serverList = sqlApp.ListAvailableSQLServers

numServers = serverList.Count
RIGA = 2

For I = 1 To numServers

TEST = serverList(I)

Range("A" + RIGA) = TEST

Set sqlApp = Nothing

End Sub
Jun 12 '06 #1
0 1961

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Brian Murphy | last post: by
10 posts views Thread by John | last post: by
49 posts views Thread by Mike MacSween | last post: by
9 posts views Thread by David Teran | last post: by
11 posts views Thread by eureka | last post: by
15 posts views Thread by (PeteCresswell) | last post: by
reply views Thread by leo001 | last post: by

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.