Is there any way in SQL Server to check if a specific server is connected, if not than to connect, but in a automatic way?
TIA
>A linked server is an internal SQL Server object. It's not visible or accessible from outside of the SQL Server instance.
>
>>this is something what I'm looking for.
>>Just a question, will it show a linked server?
>>
>>I have to test if a specific SQL Server is connected, if it's not connected, connect using "EXEC sp_addlinkedserver....." .
>>
>>I made a test but the result is mixed, in some PC it only returns the local SQL Server (developer), in other it doesnt returns the SQL Server from the network, even if the server is mapped in the PC station.
>>Here it doesnt showed the linked server in no PC station, any ideia why?
>>I thing this is a stranger behavior why in some PC's it works an in others not..
>>
>>I made a test with SQL 2000 and it failed.
>>I the past the first code above always worked in SQL 2000, now it doesnt returns any walued even it theres a SQL Server in the PC station....
>>
>>LOCAL oSQLDMO AS SQLDMO.SQLserver
>>LOCAL oNames AS SQLDMO.NameList
>>oSQLDMO = CREATEOBJECT("SQLDMO.SQLserver")
>>oNames = oSQLDMO.APPLICATION.ListAvailableSQLServers()
>>FOR ix=1 TO oNames.COUNT
>> ? oNames.ITEM[ix]
>>ENDFOR
>>
>>
>>The same mixed results in SQL 2005 and 2008
>>
>>Thanks