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