Is it possible to do the following. If yes then how ?
- Is there a way to find out all the instances of the SQL server running ?
- Read the alerts generated by SQL server.
- Read the logs generated by SQL server.
Thanks,
-FatemaFatema
CREATE PROCEDURE dbo.ListLocalServers
AS
BEGIN
SET NOCOUNT ON
CREATE TABLE #servers(sname VARCHAR(255))
INSERT #servers EXEC master..XP_CMDShell 'OSQL -L'
DELETE #servers WHERE sname='Servers:'
SELECT LTRIM(sname) FROM #servers WHERE sname != 'NULL'
DROP TABLE #servers
END
Read up in the BOL chapter "Viewing the SQL Server Error Log"
"Fatema" <Fatema@.discussions.microsoft.com> wrote in message
news:02D6FC75-FC5B-47A8-ACAE-90D350B4FC90@.microsoft.com...
> Is it possible to do the following. If yes then how ?
> - Is there a way to find out all the instances of the SQL server running ?
> - Read the alerts generated by SQL server.
> - Read the logs generated by SQL server.
> Thanks,
> -Fatema|||Thanks for the reply.
On executing this procedure it gives me an error:
Login Failed. Reason: not associated with a trusted SQL server connection.
What is the problem ?
TIA,
-Fatema
"Uri Dimant" wrote:
> Fatema
> CREATE PROCEDURE dbo.ListLocalServers
> AS
> BEGIN
> SET NOCOUNT ON
> CREATE TABLE #servers(sname VARCHAR(255))
> INSERT #servers EXEC master..XP_CMDShell 'OSQL -L'
> DELETE #servers WHERE sname='Servers:'
> SELECT LTRIM(sname) FROM #servers WHERE sname != 'NULL'
> DROP TABLE #servers
> END
>
> Read up in the BOL chapter "Viewing the SQL Server Error Log"
> "Fatema" <Fatema@.discussions.microsoft.com> wrote in message
> news:02D6FC75-FC5B-47A8-ACAE-90D350B4FC90@.microsoft.com...
>
>|||Fatema
Change (SQL Server Properties)
under Security Tab -Authentication to SQL Server and Windows
"Fatema" <Fatema@.discussions.microsoft.com> wrote in message
news:32B44E26-E20A-40A7-BB3C-CC526F2E0BF3@.microsoft.com...
> Thanks for the reply.
> On executing this procedure it gives me an error:
> Login Failed. Reason: not associated with a trusted SQL server connection.
> What is the problem ?
> TIA,
> -Fatema
> "Uri Dimant" wrote:
>
running ?|||I am getting the following o/p :
Name (column)
--
Password
1>
WHat does this mean ?
-Fatema
"Uri Dimant" wrote:
> Fatema
> Change (SQL Server Properties)
> under Security Tab -Authentication to SQL Server and Windows
>
>
> "Fatema" <Fatema@.discussions.microsoft.com> wrote in message
> news:32B44E26-E20A-40A7-BB3C-CC526F2E0BF3@.microsoft.com...
> running ?
>
>|||1. Not in a reliable way. Uri posted a method, but please be aware that all
methods (all are based
on API calls in Windows) are based on browser service in Windows and it is n
ot guaranteed to show
all servers, also servers can be in the browser list after it was shut down.
2. Can you define what you mean by alerts?
3. Can you define what you mean by "logs"?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Fatema" <Fatema@.discussions.microsoft.com> wrote in message
news:02D6FC75-FC5B-47A8-ACAE-90D350B4FC90@.microsoft.com...
> Is it possible to do the following. If yes then how ?
> - Is there a way to find out all the instances of the SQL server running ?
> - Read the alerts generated by SQL server.
> - Read the logs generated by SQL server.
> Thanks,
> -Fatema|||Can you please tell me how is it possible to programmatically find out all
instances of sql server that are running ?
By logs I mean the logs that sql server generates during its course of
execution.
Thanks,
-fatema
"Tibor Karaszi" wrote:
> 1. Not in a reliable way. Uri posted a method, but please be aware that al
l methods (all are based
> on API calls in Windows) are based on browser service in Windows and it is
not guaranteed to show
> all servers, also servers can be in the browser list after it was shut dow
n.
> 2. Can you define what you mean by alerts?
> 3. Can you define what you mean by "logs"?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Fatema" <Fatema@.discussions.microsoft.com> wrote in message
> news:02D6FC75-FC5B-47A8-ACAE-90D350B4FC90@.microsoft.com...
>
>|||> Can you please tell me how is it possible to programmatically find out all
> instances of sql server that are running ?
As I already replied: Not reliably. Search the newsgroup archives and you wi
ll probably find posts
from Gert Drapers specifying the technicalities behind this. If you want to
list the servers anyhow
(unreliably), you have classes for that in, for instance, SQLDMO. See www.sqldev.n
et for examples.
> By logs I mean the logs that sql server generates during its course of
> execution.
Errorlog? Transaction log? Entries the in the eventlog? Do you want to get t
o this using TSQL or a
client programming language, like VB.NET?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Fatema" <Fatema@.discussions.microsoft.com> wrote in message
news:353E84EC-5811-4D21-86A4-19B8F5C3A69E@.microsoft.com...
> Can you please tell me how is it possible to programmatically find out all
> instances of sql server that are running ?
> By logs I mean the logs that sql server generates during its course of
> execution.
> Thanks,
> -fatema
>
> "Tibor Karaszi" wrote:
>|||Tibor,
Another problem with OSQL -L is that it list whatever alias you create with
"Client Network Utility" even though there is not a physical server
associated to this alias.
AMB
"Tibor Karaszi" wrote:
> 1. Not in a reliable way. Uri posted a method, but please be aware that al
l methods (all are based
> on API calls in Windows) are based on browser service in Windows and it is
not guaranteed to show
> all servers, also servers can be in the browser list after it was shut dow
n.
> 2. Can you define what you mean by alerts?
> 3. Can you define what you mean by "logs"?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Fatema" <Fatema@.discussions.microsoft.com> wrote in message
> news:02D6FC75-FC5B-47A8-ACAE-90D350B4FC90@.microsoft.com...
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment