Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for linked server

Status
Not open for further replies.

Denaeghel

Programmer
Apr 23, 2001
61
BE
Hello

I want to see all views, stored procedures, ... (from all databases in a SQL-group) where I make a connection with a linked server.

Thanks in advanced

Karel
karel.denaeghel@barco.com
 
Since you have a link to the server, you can access all object on that other server just as you would the ones on your server, the only thing you need to do is fully qualify the name of the object, i.e [Server-Name].[Owner].[Database].[Table-Name].

The names of the tables and views are in the SYSOBJECTS tables in each database. As a precaution only mess with user objects. The XType field gives you that info (Object type. Can be one of these object types:
C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
L = Log
FN = Scalar function
IF = Inlined table-function
P = Stored procedure
PK = PRIMARY KEY constraint (type is K)
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
UQ = UNIQUE constraint (type is K)
V = View
X = Extended stored procedure)

The servers are kept in the SYSSERVERS table in Master DB.
If you intend to do this from a client you could use SQL-DMO or stored procedures.

Hope this helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top