Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Programming / SQL / July 2008

Tip: Looking for answers? Try searching our database.

Connection Status

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Agho - 17 Jul 2008 17:05 GMT
I have a table with the following information/columns:

ServerName
UserName
PWord
ConnectionStatus

I want to write a SQL script that will test the user connection with the
information in the table and update the ConnectionStatus column with a zero
(0) if the connection is successful. I am basically trying to verify that the
password in the table is correct without having to do it manually.

Thanks
Agho - 17 Jul 2008 21:46 GMT
I found a way. I will be using the osql command to do the testing and test
for an error. The command I will use is as follows:

select 'osql -S ' + ServerName + ' -U serName -P ' + PWord + ' -q "select
getdate()"'

I just have to pass the result of the select statement to
master.dbo.xp_cmdshell and check for a failure.

Thanks.

> I have a table with the following information/columns:
>
[quoted text clipped - 9 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.