Showing posts with label event. Show all posts
Showing posts with label event. Show all posts

Friday, March 30, 2012

Login failed for user NT AUTHORITY\NETWORK SERVICE

Hi All,
I've done some searching around but can't find an answer to this problem.
I've recently noticed an error in the event logs relating to the Network
Service account trying to connect to my SQL 2005 server. The logs give me
the following information :-
12/06/2007 23:30:01,Logon,Unknown,Login failed for user 'NT
AUTHORITY\NETWORK SERVICE'. [CLIENT: 10.0.0.4]
12/06/2007 23:30:01,Logon,Unknown,Error: 18456<c/> Severity: 14<c/> State: 1
6.
This is all the info I have to go on. Can anyone provide me with some
assistance with trying to troubleshoot?Well, it seems that some process working in Network Service user context is
trying to connect your instance and Network Service has no permission to
connect the target database in SQL Server. Run SQL Server Profiler and catch
failed login attempts (catch Audit Login Failed event with ApplicationName
and DatabaseName columns selected to trace).
Regards
Pawel Potasinski
[http://www.potasinski.pl]
Uytkownik "Matt" <Matt@.discussions.microsoft.com> napisa w wiadomoci
news:AB02D9C1-DF84-4A43-BCA5-4A84B8323525@.microsoft.com...
> Hi All,
> I've done some searching around but can't find an answer to this problem.
> I've recently noticed an error in the event logs relating to the Network
> Service account trying to connect to my SQL 2005 server. The logs give me
> the following information :-
> 12/06/2007 23:30:01,Logon,Unknown,Login failed for user 'NT
> AUTHORITY\NETWORK SERVICE'. [CLIENT: 10.0.0.4]
> 12/06/2007 23:30:01,Logon,Unknown,Error: 18456<c/> Severity: 14<c/> State:
> 16.
> This is all the info I have to go on. Can anyone provide me with some
> assistance with trying to troubleshoot?|||Thanks Pawel,
The only way I am able to force the netork login failure is by restarting
the MSSQL server process. Of course, when I do this with the Profiler
running, I end up with a Trace error in the log as soon as the server goes
online and the logging stops. Any idea how I can make the Profiler keep
running even when the server gets restarted? Or is there a way that I can
make the profiler start when the server starts before loading anything else?
Matt
"Pawel Potasinski" wrote:

> Well, it seems that some process working in Network Service user context i
s
> trying to connect your instance and Network Service has no permission to
> connect the target database in SQL Server. Run SQL Server Profiler and cat
ch
> failed login attempts (catch Audit Login Failed event with ApplicationName
> and DatabaseName columns selected to trace).
> --
> Regards
> Pawel Potasinski
> [http://www.potasinski.pl]
>
> U?ytkownik "Matt" <Matt@.discussions.microsoft.com> napisa3 w wiadomo?ci
> news:AB02D9C1-DF84-4A43-BCA5-4A84B8323525@.microsoft.com...
>
>|||I ment to say "I end up with a Trace error in the log as soon as the server
goes
OFFLINE and the logging stops".
Just to be clear, I see the Failed Audit login message in the SQL log only
when I start the start the server. It doesnn't continuely happen, therefore
the only time I can try and trace the cause of the issue is as the server
starts up
"Matt" wrote:
[vbcol=seagreen]
> Thanks Pawel,
> The only way I am able to force the netork login failure is by restarting
> the MSSQL server process. Of course, when I do this with the Profiler
> running, I end up with a Trace error in the log as soon as the server goes
> online and the logging stops. Any idea how I can make the Profiler keep
> running even when the server gets restarted? Or is there a way that I can
> make the profiler start when the server starts before loading anything els
e?
> Matt
> "Pawel Potasinski" wrote:
>|||OK, with a bit of luck, patience and timing, I managed to get a trace of the
Audit Login Failed notice. It looks like our CRM application is having a ba
d
day and isn't able to logon to something. However, even though I enabled al
l
columns in the Profiler and made sure DatabaseName column was selected, I
only get columns ApplicationName - TextData listed. The all-important info
aon what table the service is trying to access is still missing.
Any thoughts?
"Matt" wrote:
[vbcol=seagreen]
> I ment to say "I end up with a Trace error in the log as soon as the serve
r
> goes
> OFFLINE and the logging stops".
> Just to be clear, I see the Failed Audit login message in the SQL log only
> when I start the start the server. It doesnn't continuely happen, therefo
re
> the only time I can try and trace the cause of the issue is as the server
> starts up
> "Matt" wrote:
>|||Matt (Matt@.discussions.microsoft.com) writes:
> OK, with a bit of luck, patience and timing, I managed to get a trace of
> the Audit Login Failed notice. It looks like our CRM application is
> having a bad day and isn't able to logon to something. However, even
> though I enabled all columns in the Profiler and made sure DatabaseName
> column was selected, I only get columns ApplicationName - TextData
> listed. The all-important info aon what table the service is trying to
> access is still missing.
It's seems difficult to find out which table the CRM app is trying to
access, when it does not comes as far as connecting...
Then again, if you get a single login failure when you start SQL Server,
and the CRM application does not produce an error, maybe this is not
really an issue to lose sleep over?
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Matt,
Is this a standalone server or a cluster? have you recently upgraded to W2K3
SP2? We now see this when we patch or failover our clustered SQL2005 server.
Chris
"Matt" <Matt@.discussions.microsoft.com> wrote in message
news:8AEE2C89-5A8C-4005-A241-862CAE01CE38@.microsoft.com...[vbcol=seagreen]
>I ment to say "I end up with a Trace error in the log as soon as the server
> goes
> OFFLINE and the logging stops".
> Just to be clear, I see the Failed Audit login message in the SQL log only
> when I start the start the server. It doesnn't continuely happen,
> therefore
> the only time I can try and trace the cause of the issue is as the server
> starts up
> "Matt" wrote:
>

Wednesday, March 28, 2012

Login failed for user Domainname\computername

Hi,

I am using SQL Server 2005. The below message is added to the Application Event Viewer frequently.

Failure Audit: Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

abc is my domain name and xyz is my computer name.

When I look @. the SQL error logs, I find the following message:

Error 18456 Severity 14 state 11

Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

Please let me know if you have any suggessions.

Thanks

Santhosh

It seems like a service running in the computer xyz is trying to connect to your SQL Server instance. This service must likely is running with local system or network service credentials.

I would recommend investigating what is this service by verifying the services installed in machine xyz; and if indeed it is a service that should be connecting to that SQL Server instance, you can grant access by creating a login for the Windows user [abc\xyz$] and then grant proper permissions.

I hope this information helps. Let us know if you have any further questions.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||But, xyz$ is a computer account. How can I create a login for Computer Account in SQL? Is this possible?|||

CREATE LOGIN [abc\xyz$] FROM WINDOWS

It should work, let us know if it worked.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||

Hi Raul,

I created the login using the above mentioned command. It created find.

But, now I get two messages in event viewer.

One is success audit where is says login successful for user abc\xyz$.

immeditely, it also logs in the below failure message.

Failure Audit: Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

In the earlier posts, you had mentioned about granting permissions to abc\xyz$ account?

What permissions should we grant.

Can you also help me with the syntax to grant those permissions.

Thanks

Santhosh

|||

Creating the loginshould typically be enough to connect to the system (using master DB).I would recommend using SLQ Server Profiler and check the Security Events section (mark show all events to see all possibilities), to be more specific mark everything under Audit Login & Audit logout

I hope this helps,

-Raul Garcia

SDE/T

SQL Server Engine

|||

We created a login for the computer account name in SQL Server.
From SQL Server, we ran
CREATE LOGIN [Domainname\computername$] FROM WINDOWS
The login created successfully.
Now, we see two audit messages for Domainname\Computername$.
First audit message is..

Login Succeded for user Domainname\Computername$. Connection Trusted.(Client :xx.xx.xx.xx)
Second Audit message is.. Login failed for user Domainname\Computername$. (Client :xx.xx.xx.xx)

Before creating the login, we had only login failed message. But, now we get login succeded message and login failed message for the same username.

Any thoughts would be helpful.

Thanks

Santhosh

|||

Unfortunately I really have no idea on what may be happening. I would suggest trying to enable other events, including any permission checks or any queries being started. Hopefully this extra information will give us a clue on why the connection is failing.

-Raul Garcia

SDE/T

SQL Server Engine

Login failed for user Domainname\computername

Hi,

I am using SQL Server 2005. The below message is added to the Application Event Viewer frequently.

Failure Audit: Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

abc is my domain name and xyz is my computer name.

When I look @. the SQL error logs, I find the following message:

Error 18456 Severity 14 state 11

Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

Please let me know if you have any suggessions.

Thanks

Santhosh

It seems like a service running in the computer xyz is trying to connect to your SQL Server instance. This service must likely is running with local system or network service credentials.

I would recommend investigating what is this service by verifying the services installed in machine xyz; and if indeed it is a service that should be connecting to that SQL Server instance, you can grant access by creating a login for the Windows user [abc\xyz$] and then grant proper permissions.

I hope this information helps. Let us know if you have any further questions.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||But, xyz$ is a computer account. How can I create a login for Computer Account in SQL? Is this possible?|||

CREATE LOGIN [abc\xyz$] FROM WINDOWS

It should work, let us know if it worked.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||

Hi Raul,

I created the login using the above mentioned command. It created find.

But, now I get two messages in event viewer.

One is success audit where is says login successful for user abc\xyz$.

immeditely, it also logs in the below failure message.

Failure Audit: Login failed for user "abc\xyz$". (Client: xx.xx.xx.xx)

In the earlier posts, you had mentioned about granting permissions to abc\xyz$ account?

What permissions should we grant.

Can you also help me with the syntax to grant those permissions.

Thanks

Santhosh

|||

Creating the loginshould typically be enough to connect to the system (using master DB).I would recommend using SLQ Server Profiler and check the Security Events section (mark show all events to see all possibilities), to be more specific mark everything under Audit Login & Audit logout

I hope this helps,

-Raul Garcia

SDE/T

SQL Server Engine

|||

We created a login for the computer account name in SQL Server.
From SQL Server, we ran
CREATE LOGIN [Domainname\computername$] FROM WINDOWS
The login created successfully.
Now, we see two audit messages for Domainname\Computername$.
First audit message is..

Login Succeded for user Domainname\Computername$. Connection Trusted.(Client :xx.xx.xx.xx)
Second Audit message is.. Login failed for user Domainname\Computername$. (Client :xx.xx.xx.xx)

Before creating the login, we had only login failed message. But, now we get login succeded message and login failed message for the same username.

Any thoughts would be helpful.

Thanks

Santhosh

|||

Unfortunately I really have no idea on what may be happening. I would suggest trying to enable other events, including any permission checks or any queries being started. Hopefully this extra information will give us a clue on why the connection is failing.

-Raul Garcia

SDE/T

SQL Server Engine

Monday, March 19, 2012

login failed events for administrator account??

Hi,
I see a lot of login failed errors in the event log.
its the domain\administrator account.
the data associated to this event is:
<server name>.master
I suppose its an access to the master database the reason of this error.
but the user has access to this database.
the event is generated every 10 minutes and 5 minutes later then again 10
minutes...
any idea?
thanks.
Jerome.Maybe some service is trying to connect? You could get more data with
Profiler, tray to catch this login failed event.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Jj" <willgart@.AAAhotmailBBB.com> wrote in message
news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I see a lot of login failed errors in the event log.
> its the domain\administrator account.
> the data associated to this event is:
> <server name>.master
> I suppose its an access to the master database the reason of this error.
> but the user has access to this database.
> the event is generated every 10 minutes and 5 minutes later then again 10
> minutes...
> any idea?
> thanks.
> Jerome.
>|||I have identified that its portal server the service which generate this
error.
I try to change some config in sharepoint, but the error is here again.
also this account access all databases without any problem, portal server
generates a lot of access but only 1 (but unidentified) of these requests
failed.
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:OufyX6FrFHA.2008@.TK2MSFTNGP10.phx.gbl...
> Maybe some service is trying to connect? You could get more data with
> Profiler, tray to catch this login failed event.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "Jj" <willgart@.AAAhotmailBBB.com> wrote in message
> news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
>

login failed events for administrator account??

Hi,
I see a lot of login failed errors in the event log.
its the domain\administrator account.
the data associated to this event is:
<server name>.master
I suppose its an access to the master database the reason of this error.
but the user has access to this database.
the event is generated every 10 minutes and 5 minutes later then again 10
minutes...
any idea?
thanks.
Jerome.Maybe some service is trying to connect? You could get more data with
Profiler, tray to catch this login failed event.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Jéjé" <willgart@.AAAhotmailBBB.com> wrote in message
news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I see a lot of login failed errors in the event log.
> its the domain\administrator account.
> the data associated to this event is:
> <server name>.master
> I suppose its an access to the master database the reason of this error.
> but the user has access to this database.
> the event is generated every 10 minutes and 5 minutes later then again 10
> minutes...
> any idea?
> thanks.
> Jerome.
>|||I have identified that its portal server the service which generate this
error.
I try to change some config in sharepoint, but the error is here again.
also this account access all databases without any problem, portal server
generates a lot of access but only 1 (but unidentified) of these requests
failed.
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:OufyX6FrFHA.2008@.TK2MSFTNGP10.phx.gbl...
> Maybe some service is trying to connect? You could get more data with
> Profiler, tray to catch this login failed event.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "Jéjé" <willgart@.AAAhotmailBBB.com> wrote in message
> news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
>> Hi,
>> I see a lot of login failed errors in the event log.
>> its the domain\administrator account.
>> the data associated to this event is:
>> <server name>.master
>> I suppose its an access to the master database the reason of this error.
>> but the user has access to this database.
>> the event is generated every 10 minutes and 5 minutes later then again 10
>> minutes...
>> any idea?
>> thanks.
>> Jerome.
>

login failed events for administrator account??

Hi,
I see a lot of login failed errors in the event log.
its the domain\administrator account.
the data associated to this event is:
<server name>.master
I suppose its an access to the master database the reason of this error.
but the user has access to this database.
the event is generated every 10 minutes and 5 minutes later then again 10
minutes...
any idea?
thanks.
Jerome.
Maybe some service is trying to connect? You could get more data with
Profiler, tray to catch this login failed event.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Jj" <willgart@.AAAhotmailBBB.com> wrote in message
news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I see a lot of login failed errors in the event log.
> its the domain\administrator account.
> the data associated to this event is:
> <server name>.master
> I suppose its an access to the master database the reason of this error.
> but the user has access to this database.
> the event is generated every 10 minutes and 5 minutes later then again 10
> minutes...
> any idea?
> thanks.
> Jerome.
>
|||I have identified that its portal server the service which generate this
error.
I try to change some config in sharepoint, but the error is here again.
also this account access all databases without any problem, portal server
generates a lot of access but only 1 (but unidentified) of these requests
failed.
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si > wrote in
message news:OufyX6FrFHA.2008@.TK2MSFTNGP10.phx.gbl...
> Maybe some service is trying to connect? You could get more data with
> Profiler, tray to catch this login failed event.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "Jj" <willgart@.AAAhotmailBBB.com> wrote in message
> news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
>

Monday, March 12, 2012

Login Event! (or something like that)

Hi,
I need to have something like a "login event" so that whenever a user logs
into SQL server, I can execute certain commands or SPs. So far, I've been
using this event in my client app that when a user clicks on the login
button, I do those jobs. But I want SQL server to handle and perform these
activities automatically and recognize each login.
Any help would be greatly appreciated.
AminTHere is no such event inside SQL Server.
AND you can't put triggers on SYSprocesses (which would be the next thing to
try).
You can write a proc that watches sysprocesses for new connections, or
you can catch logins with profiler and write a program that watches the
profiler output or
you can catch logins in the SQL error log (turn this on via SQL Enterprise
Manager on the Server->security tab and write a program that watches the SQL
log but
NONE of these will allow you to run proces etc on the newly connected
thread...
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Amin Sobati" <amins@.morva.net> wrote in message
news:%23qLxNBACEHA.3784@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I need to have something like a "login event" so that whenever a user logs
> into SQL server, I can execute certain commands or SPs. So far, I've been
> using this event in my client app that when a user clicks on the login
> button, I do those jobs. But I want SQL server to handle and perform these
> activities automatically and recognize each login.
> Any help would be greatly appreciated.
> Amin
>

login event in sql server ?

Hi,
is there a way in SQL 2000 to check a new login and to stop it?
I want to be informed if a user makes a new connect, then i want to check
the program name he uses for connect and if this is not a valid name i want
to cancel his login.
I think it should be possible with a trigger on the table where system
information about login is written, but i don't know which table.
If i have this info i could KILL unvalid connects.
thanks,
HelmutHi
In SQL Server 2000, you can not put a trigger on a system table.
You can do this though a SQL Server agent job every minute, and then code a
sp_kill to the connection that you want to kill.
BTW, the Program ID can be faked very easily as you can set it in the
connection string, so once your users/customer figure out the string you are
checking for, you could use another application to connect to the database.
You have to be very careful, as you must not kill system SPIDs, or other
ones like SQL Server agent jobs, or tools that allow you to manage the
server, as you could lock yourself out.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"helmut woess" <hw@.iis.at> wrote in message
news:5i60470r8j6x$.14q28ljnstqpf$.dlg@.40tude.net...
> Hi,
> is there a way in SQL 2000 to check a new login and to stop it?
> I want to be informed if a user makes a new connect, then i want to check
> the program name he uses for connect and if this is not a valid name i
> want
> to cancel his login.
> I think it should be possible with a trigger on the table where system
> information about login is written, but i don't know which table.
> If i have this info i could KILL unvalid connects.
> thanks,
> Helmut|||Hi
If you want to limit access like this then the most common solution would be
users table which you validate against. If you want to limit access to a
given application, then you may want to also have an application role. In
general this looks like your permissions may be too wide, or you lack
control over the logins.
John
"helmut woess" <hw@.iis.at> wrote in message
news:5i60470r8j6x$.14q28ljnstqpf$.dlg@.40tude.net...
> Hi,
> is there a way in SQL 2000 to check a new login and to stop it?
> I want to be informed if a user makes a new connect, then i want to check
> the program name he uses for connect and if this is not a valid name i
> want
> to cancel his login.
> I think it should be possible with a trigger on the table where system
> information about login is written, but i don't know which table.
> If i have this info i could KILL unvalid connects.
> thanks,
> Helmut|||Am Sat, 17 Dec 2005 19:09:57 +0100 schrieb Mike Epprecht (SQL MVP):

> Hi
> In SQL Server 2000, you can not put a trigger on a system table.
>
Oh, i didn't know that. This makes the realisation of my idea impossible,
because i want to prevent login immediately, not after 30 seconds or so. It
must look to the user as if he used a wrong password.
but thanks,
Helmut|||Am Sat, 17 Dec 2005 18:33:39 -0000 schrieb John Bell:
...
> If you want to limit access like this then the most common solution would
be
> users table which you validate against. If you want to limit access to a
> given application, then you may want to also have an application role. In
> general this looks like your permissions may be too wide, or you lack
> control over the logins.
>
It was part of a bigger project to prevent login if the user uses another
application as my program. But because i cannot use triggers on system
tables (as Mike told me) this idea has died.
thanks,
Helmut|||Hi Helmut
You can therefore use an application role to obfuscate this.
John

Friday, February 24, 2012

Logging using OnError Event

Hi

We are generating log file in our SSIS package by enabling the built-in feature of SSIS tool. We are generating log for the "OnError" event. This also recorded the error/failed task messages in the text file "log.txt". That error information is too complex with more unwanted information like below

-OnError,,,pkgExtract,,,8/30/2006 11:50:04 AM,8/30/2006 11:50:04 AM,-1071636471,0x,An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".

OnError,,,pkgExtract,,,8/30/2006 11:50:04 AM,8/30/2006 11:50:04 AM,-1071607780,0x,There was an error with input column "create_user_id" (116) on input "OLE DB Destination Input" (103). The column status returned was: "The value violated the integrity constraints for the column.".

OnError,,,pkgExtract,,,8/30/2006 11:50:04 AM,8/30/2006 11:50:04 AM,-1071607767,0x,The "input "OLE DB Destination Input" (103)" failed because error code 0xC020907D occurred, and the error row disposition on "input "OLE DB Destination Input" (103)" specifies failure on error. An error occurred on the specified object of the specified component.

This is infact not in a better readable format. We also don't want to do our error logging in database.

Is there any way of defining our error log and create error error log with customization of our messages . Can we do it using OnError event handler.

Please help us with some good solution to avoid giving this confused error log messages.

Thanks

Kumaran

Sure, you can do that. Read this: http://blogs.conchango.com/jamiethomson/archive/2005/06/11/1593.aspx

-Jamie

Logging to Event Viewer "fails" but SQL Server logging works OK - why?

Greetings,

I am developing a package on my local workstation. I have defined two logging service providers. One is for SQL Server and the other is for the Windows Event Log. I am using the Dts.Log method in a script task to write log entries.

Logging is working properly with the SQL Server provider and rows are being inserted into the sysdtslog90 table. However, the only events that are being logged in the Windows Event Log are the package start and end events which I believe SSIS is doing automatically anyway.

Is there something I need to do to enable WIndows Event Log logging other than defining a log provider and making sure it is checked active? Won't SSIS write to two different logs with one Dts.Log call? Any ideas on what might be going wrong with my approach?

Thanks,

BCB

The answer is no - SSIS won't write to the Windows event log with one Dts.Log call. Writing to the event log takes a little more doing. The following code shows a method I used to do logging to the Windows event log. "rowsInserted" is a parameter that is specific to our business requirements. It can be omitted for most uses.

Public Sub WriteEventLogEntry(ByVal logMessage As String, ByVal entryType As EventLogEntryType, ByVal rowsInserted As Integer)

Try

Dim source As String

Dim log As String

Dim machine As String

' get system variables recorded in event log

Dim vars As Variables

Dts.VariableDispenser.LockOneForRead("System:Stick out tongueackageName", vars)

source = vars("PackageName").Value.ToString()

Dts.VariableDispenser.LockOneForRead("System::MachineName", vars)

machine = vars("MachineName").Value.ToString()

' log in Application group

log = "Application"

If Not EventLog.SourceExists(source, machine) Then

EventLog.CreateEventSource(source, log, machine)

End If

Dim eLog As New EventLog(log, machine, source)

If (rowsInserted >= 0) Then

eLog.WriteEntry(logMessage, entryType, rowsInserted)

Else

eLog.WriteEntry(logMessage, entryType) ' log does not allow negative numbers

End If

Catch ex As Exception

' do nothing - let processing continue

End Try

End Sub

Monday, February 20, 2012

Logging the control flow hierarchy

Hello,

I am using the event handling mechanism to do my custom logging. This works fine. Using the OnPreExecute and OnPostExecute my log tables fill up with the start- and enddates of all the containers and tasks in the complete package hierarchy.

However, what I am missing (e.g. in a system variable) is the source ID of the parent container that started the task or container. In other words, in my logging reports, I would like to build up a tree starting with the topmost package, like the progress indication in the IDE.

The built-in Logging features do not log this information either as far as I can tell.

Does anyone know how to do this?

Kind regards,
Jeroen

Watch the Kimball Webcast listed on the first page of this forum. Joy Mundy talks about auditing and she shares with us quite a bit about it and how she did it. One of the things she does is to log the parent package's information and then each child it executes logs its own information along with the parent ID so that everything is tied together.|||

Hi Jeroen,

If you enable logging in parent container this will be done automatically in log file created by SSIS. If you are looking for custom logs then you can use Dts.Log() method to write custom logs. I believe you will have to write your own logic using ScriptTask to build a tree structure for logs.

Thanks

Mohit

|||

MohitGupta wrote:

If you are looking for custom logs then you can use Dts.Log() method to write custom logs.

More information on how to create a custom log provider can be found here: http://msdn2.microsoft.com/en-us/library/ms136010.aspx

Logging Packages Execution

Hello all,

I am struggling around defining a logging mechanism for my packages. I have 2 questions concerning that matter:

I have used event handlers for my loggings (as defined here: http://blogs.conchango.com/jamiethomson/archive/2005/06/11/1593.aspx ), but the problem is with packages that failed validation. I cannot find log entry for these cases since no "onerror event" doesn't trigger (for instance when the table I'm loading to doesn't exsist).


And the second question: many of my packages are executed using execute process task (using dtexec command line). I am trying to capture the result of the execution as a log file by using the ">" in the command line in order to output the execution to a log file in the following format:
dtexec /FILE "MyPackage.dtsx" > " MyPackageLog.log"
This works fine when executed by myself but when using the Execute Process task (defined: Executable: DTExec.exe, Arguments: /FILE "MyPackage.dtsx" > " MyPackageLog.log") I get execution error…

Thanks,

Liran


Liran R wrote:

... I am trying to capture the result of the execution as a log file by using the ">" in the command line in order to output the execution to a log file in the following format:
dtexec /FILE "MyPackage.dtsx" > " MyPackageLog.log"
This works fine when executed by myself but when using the Execute Process task (defined: Executable: DTExec.exe, Arguments: /FILE "MyPackage.dtsx" > " MyPackageLog.log") I get execution error…

Regarding the second issue: output redirection (">") is feature of command shell (cmd.exe). So it works "when executed by myself" because it is executed by cmd.exe, not by itself - cmd.exe intercepts ">" symbol and does the redirection.

When you specify DTExec.exe as your executable you don't get this feature, ">" is simply passed as argument to DTExec.exe and DTExec reports an error as it does not recognize it as valid argument. You need to specify cmd.exe as executable and use /C DTEXEC.EXE /F "MyPackage.dtsx" >MyLog.log as arguments.

|||

Thanks.

Does anybody else misses the DTS2000 Logging feature, or is it just me...

|||

Why not use the Execute Package tasks. All events will get passed up to the parent.

I guess your error is prior to execution, so before logging starts.

For the Execute Process task, could you not capture what you want via the StandardOutput/Error variables?

|||

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

|||

Liran R wrote:

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

You can do the same with the Execute Package Task i.e. Make it dynamic.

You do this using expressions. This may help:

Setting expressions
(http://blogs.conchango.com/jamiethomson/archive/2006/03/11/3063.aspx)

In answer to your other earlier question: No, I don't miss DTS logging at all. It was cumbersome, incomplete and unextensible to the extreme.

-Jamie

|||

Liran R wrote:

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

Besides to expressions I would look at package configurations as well.

Rafael Salas

|||

Jamie Thomson wrote:

Liran R wrote:

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

You can do the same with the Execute Package Task i.e. Make it dynamic.

You do this using expressions. This may help:

Setting expressions
(http://blogs.conchango.com/jamiethomson/archive/2006/03/11/3063.aspx)

In answer to your other earlier question: No, I don't miss DTS logging at all. It was cumbersome, incomplete and unextensible to the extreme.

-Jamie

Yes, I thought about that, but the problem is I want to execute my packages in parallel, not in a loop.

|||

Liran R wrote:

Jamie Thomson wrote:

Liran R wrote:

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

You can do the same with the Execute Package Task i.e. Make it dynamic.

You do this using expressions. This may help:

Setting expressions
(http://blogs.conchango.com/jamiethomson/archive/2006/03/11/3063.aspx)

In answer to your other earlier question: No, I don't miss DTS logging at all. It was cumbersome, incomplete and unextensible to the extreme.

-Jamie

Yes, I thought about that, but the problem is I want to execute my packages in parallel, not in a loop.

So what? All I'm saying is to use an Execute Package Task rather than an Execute Process Task. I'm not advocating use ofa Foreach loop.

-Jamie

|||

I must understand something:

If I have many Execute Package tasks running in Parrallel, all using the same connection manager (to a specific package file) how can I use a variable to set the connection string using expression if I'm not using a loop container?

Thanks,

Liran

|||

If using the Execute Package Task, how does one pass additional command line values for the package to be executed?

I'm calling my child packges that reside in FileSystem (folder) dynamically but I need to pass them the /CONFIGFILE so that they know where to grab the dtsConfig file. I can't hardcode the dtsConfig because the location of the file/folder is different from environment to env.

These are so far my findings:

1- I can use Parent Configuration Variable in the child but I didn't see an option where I can specify the dtsConfig itself and rather have to create one variable for different config values that I have in my XML.

2- Hardcode the dtsConfig location and force the DBA to let me have a fixed folder for all the environments

3- Instead of using File System, switch to SQL Server and use the manifest to install the child packages and therefore inherit the dtsConfig from the manifest. Change the parent to use SQL Server instead of file system. Limits me now to install every time instead of just having the dba to drop/replace the dtsx in a folder

4- Use alternative methods such as DOS Batch to call dtexec, SQL Agent, SQL stored proc, etc.

5- other workarounds but it start to get out of the child/parent solution where it would great to run the child by itself when needed and also have the parent run the child without touching any code.

I searched your blog as well as others for a solution to pass the command line via Execute Package task and I posted a separate thread with no response.

I've got a little closer by having my Connection Manager concatenating the /CONFIGFILE for my dynamic PackageToRun variable but I get a run time error that either the filename, directory name or volume lable syntax is incorrect. Both dtsx and dtsConfig are in the same folder and the syntax/string looks good (except perhaps maybe it doesn't like the double quotes).

Any suggestions? With so many people advocating Execute Package Task's flexibility and dtsConfig Files (in general), I don't see any solutions to my problem without a big workaround.

Anatole

Logging Packages Execution

Hello all,

I am struggling around defining a logging mechanism for my packages. I have 2 questions concerning that matter:

I have used event handlers for my loggings (as defined here: http://blogs.conchango.com/jamiethomson/archive/2005/06/11/1593.aspx ), but the problem is with packages that failed validation. I cannot find log entry for these cases since no "onerror event" doesn't trigger (for instance when the table I'm loading to doesn't exsist).


And the second question: many of my packages are executed using execute process task (using dtexec command line). I am trying to capture the result of the execution as a log file by using the ">" in the command line in order to output the execution to a log file in the following format:
dtexec /FILE "MyPackage.dtsx" > " MyPackageLog.log"
This works fine when executed by myself but when using the Execute Process task (defined: Executable: DTExec.exe, Arguments: /FILE "MyPackage.dtsx" > " MyPackageLog.log") I get execution error…

Thanks,

Liran


Liran R wrote:

... I am trying to capture the result of the execution as a log file by using the ">" in the command line in order to output the execution to a log file in the following format:
dtexec /FILE "MyPackage.dtsx" > " MyPackageLog.log"
This works fine when executed by myself but when using the Execute Process task (defined: Executable: DTExec.exe, Arguments: /FILE "MyPackage.dtsx" > " MyPackageLog.log") I get execution error…

Regarding the second issue: output redirection (">") is feature of command shell (cmd.exe). So it works "when executed by myself" because it is executed by cmd.exe, not by itself - cmd.exe intercepts ">" symbol and does the redirection.

When you specify DTExec.exe as your executable you don't get this feature, ">" is simply passed as argument to DTExec.exe and DTExec reports an error as it does not recognize it as valid argument. You need to specify cmd.exe as executable and use /C DTEXEC.EXE /F "MyPackage.dtsx" >MyLog.log as arguments.

|||

Thanks.

Does anybody else misses the DTS2000 Logging feature, or is it just me...

|||

Why not use the Execute Package tasks. All events will get passed up to the parent.

I guess your error is prior to execution, so before logging starts.

For the Execute Process task, could you not capture what you want via the StandardOutput/Error variables?

|||

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

|||

Liran R wrote:

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

You can do the same with the Execute Package Task i.e. Make it dynamic.

You do this using expressions. This may help:

Setting expressions
(http://blogs.conchango.com/jamiethomson/archive/2006/03/11/3063.aspx)

In answer to your other earlier question: No, I don't miss DTS logging at all. It was cumbersome, incomplete and unextensible to the extreme.

-Jamie

|||

Liran R wrote:

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

Besides to expressions I would look at package configurations as well.

Rafael Salas

|||

Jamie Thomson wrote:

Liran R wrote:

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

You can do the same with the Execute Package Task i.e. Make it dynamic.

You do this using expressions. This may help:

Setting expressions
(http://blogs.conchango.com/jamiethomson/archive/2006/03/11/3063.aspx)

In answer to your other earlier question: No, I don't miss DTS logging at all. It was cumbersome, incomplete and unextensible to the extreme.

-Jamie

Yes, I thought about that, but the problem is I want to execute my packages in parallel, not in a loop.

|||

Liran R wrote:

Jamie Thomson wrote:

Liran R wrote:

I cannot use the Execute Package task because I would like to create the source where the package is dynamic. By using the execute process task, I'm passing the package path as a variable in the dtexec utility args.

By using the Execute Package task, I will need to create a connection manager to every package.

You can do the same with the Execute Package Task i.e. Make it dynamic.

You do this using expressions. This may help:

Setting expressions
(http://blogs.conchango.com/jamiethomson/archive/2006/03/11/3063.aspx)

In answer to your other earlier question: No, I don't miss DTS logging at all. It was cumbersome, incomplete and unextensible to the extreme.

-Jamie

Yes, I thought about that, but the problem is I want to execute my packages in parallel, not in a loop.

So what? All I'm saying is to use an Execute Package Task rather than an Execute Process Task. I'm not advocating use ofa Foreach loop.

-Jamie

|||

I must understand something:

If I have many Execute Package tasks running in Parrallel, all using the same connection manager (to a specific package file) how can I use a variable to set the connection string using expression if I'm not using a loop container?

Thanks,

Liran

|||

If using the Execute Package Task, how does one pass additional command line values for the package to be executed?

I'm calling my child packges that reside in FileSystem (folder) dynamically but I need to pass them the /CONFIGFILE so that they know where to grab the dtsConfig file. I can't hardcode the dtsConfig because the location of the file/folder is different from environment to env.

These are so far my findings:

1- I can use Parent Configuration Variable in the child but I didn't see an option where I can specify the dtsConfig itself and rather have to create one variable for different config values that I have in my XML.

2- Hardcode the dtsConfig location and force the DBA to let me have a fixed folder for all the environments

3- Instead of using File System, switch to SQL Server and use the manifest to install the child packages and therefore inherit the dtsConfig from the manifest. Change the parent to use SQL Server instead of file system. Limits me now to install every time instead of just having the dba to drop/replace the dtsx in a folder

4- Use alternative methods such as DOS Batch to call dtexec, SQL Agent, SQL stored proc, etc.

5- other workarounds but it start to get out of the child/parent solution where it would great to run the child by itself when needed and also have the parent run the child without touching any code.

I searched your blog as well as others for a solution to pass the command line via Execute Package task and I posted a separate thread with no response.

I've got a little closer by having my Connection Manager concatenating the /CONFIGFILE for my dynamic PackageToRun variable but I get a run time error that either the filename, directory name or volume lable syntax is incorrect. Both dtsx and dtsConfig are in the same folder and the syntax/string looks good (except perhaps maybe it doesn't like the double quotes).

Any suggestions? With so many people advocating Execute Package Task's flexibility and dtsConfig Files (in general), I don't see any solutions to my problem without a big workaround.

Anatole

Logging of logon success filling up logs.

How can I turn off the logging of succesfull user logon to the databases?
This is filling up both the SQL logs and the Application event logs.
Event Type: Information
Event Source: MSSQLSERVER
Event Category: (4)
Event ID: 17055
Date: 12/07/2003
Time: 2:14:14 PM
User: N/A
Computer: ***
Description:
18454 :
Login succeeded for user '*********'. Connection: Non-Trusted.
--
John Tolmachoff
MCSE, CSSA
Owner Consultant/Engineer
eServices For YouIn enterprise manager server properties ecurity set the audit level to
not log successful logons.
Nigel Rivett (SQL Server MVP)
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Logging NT Events

Hi,
Is it possbile to retrieve all the Event Id's of a registerd source
(Ex. MSSQLSERVER)? If it possible then can we retrieve the description
of those Event Id's and can we generate the NT Event with the above NT
Event and the desc for that?
Some how I retrieve all the Event Id's of SQL Server application and
then for each Event ID retrieve the Event Id Description and gererate
the same NT Event.
SMGENIE.EXE from MS Resource kit do the same.
Can anyone please let me know if its possible.
Thanks in advance,
Regards,
PramodHi
You don't say which version of SQL server you are using! With SQL 2005 you
can use SSIS to do this, alternatively you could write your own WMI scripts
or write your own xp.
To write to the event log you can use xp_logevent, or the LOG option of
RAISERROR, but you will not have a great deal flexibility.
John
"ipramod@.gmail.com" wrote:
> Hi,
> Is it possbile to retrieve all the Event Id's of a registerd source
> (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> of those Event Id's and can we generate the NT Event with the above NT
> Event and the desc for that?
>
> Some how I retrieve all the Event Id's of SQL Server application and
> then for each Event ID retrieve the Event Id Description and gererate
> the same NT Event.
>
> SMGENIE.EXE from MS Resource kit do the same.
>
> Can anyone please let me know if its possible.
>
> Thanks in advance,
> Regards,
> Pramod
>|||Hi John,
I am using SQL Server 2000. Is there any WMI Class that gives all the
event Id's and their description?
Thanks for replying,
Regards,
Pramod Ingle
John Bell wrote:
> Hi
> You don't say which version of SQL server you are using! With SQL 2005 you
> can use SSIS to do this, alternatively you could write your own WMI scripts
> or write your own xp.
> To write to the event log you can use xp_logevent, or the LOG option of
> RAISERROR, but you will not have a great deal flexibility.
> John
> "ipramod@.gmail.com" wrote:
> > Hi,
> >
> > Is it possbile to retrieve all the Event Id's of a registerd source
> > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > of those Event Id's and can we generate the NT Event with the above NT
> > Event and the desc for that?
> >
> >
> > Some how I retrieve all the Event Id's of SQL Server application and
> > then for each Event ID retrieve the Event Id Description and gererate
> > the same NT Event.
> >
> >
> > SMGENIE.EXE from MS Resource kit do the same.
> >
> >
> > Can anyone please let me know if its possible.
> >
> >
> > Thanks in advance,
> > Regards,
> > Pramod
> >
> >|||Hi
You may want to start from these examples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
John
"ipramod@.gmail.com" wrote:
> Hi John,
> I am using SQL Server 2000. Is there any WMI Class that gives all the
> event Id's and their description?
> Thanks for replying,
> Regards,
> Pramod Ingle
>
> John Bell wrote:
> > Hi
> >
> > You don't say which version of SQL server you are using! With SQL 2005 you
> > can use SSIS to do this, alternatively you could write your own WMI scripts
> > or write your own xp.
> >
> > To write to the event log you can use xp_logevent, or the LOG option of
> > RAISERROR, but you will not have a great deal flexibility.
> >
> > John
> >
> > "ipramod@.gmail.com" wrote:
> >
> > > Hi,
> > >
> > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > of those Event Id's and can we generate the NT Event with the above NT
> > > Event and the desc for that?
> > >
> > >
> > > Some how I retrieve all the Event Id's of SQL Server application and
> > > then for each Event ID retrieve the Event Id Description and gererate
> > > the same NT Event.
> > >
> > >
> > > SMGENIE.EXE from MS Resource kit do the same.
> > >
> > >
> > > Can anyone please let me know if its possible.
> > >
> > >
> > > Thanks in advance,
> > > Regards,
> > > Pramod
> > >
> > >
>|||Hi John,
The link you specified does not indicate how to get all event id's of a
registered source and also does not specify how to write events.
Thanks for your suggestion. Expecting more help :-)
Regards
Pramod
John Bell wrote:
> Hi
> You may want to start from these examples:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> John
> "ipramod@.gmail.com" wrote:
> > Hi John,
> >
> > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > event Id's and their description?
> >
> > Thanks for replying,
> > Regards,
> > Pramod Ingle
> >
> >
> > John Bell wrote:
> > > Hi
> > >
> > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > or write your own xp.
> > >
> > > To write to the event log you can use xp_logevent, or the LOG option of
> > > RAISERROR, but you will not have a great deal flexibility.
> > >
> > > John
> > >
> > > "ipramod@.gmail.com" wrote:
> > >
> > > > Hi,
> > > >
> > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > Event and the desc for that?
> > > >
> > > >
> > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > the same NT Event.
> > > >
> > > >
> > > > SMGENIE.EXE from MS Resource kit do the same.
> > > >
> > > >
> > > > Can anyone please let me know if its possible.
> > > >
> > > >
> > > > Thanks in advance,
> > > > Regards,
> > > > Pramod
> > > >
> > > >
> >
> >|||Hi
The last example show you almost everything that you need to do, it is not a
great step to work out how to limit the sourcename by changing the where
clause in the query or specifying specific EventCode values. If you can't
then the following explains how to use WQL
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
See also
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
for more information on what the Win32_NTLogEvent class contains
"ipramod@.gmail.com" wrote:
> Hi John,
> The link you specified does not indicate how to get all event id's of a
> registered source and also does not specify how to write events.
> Thanks for your suggestion. Expecting more help :-)
> Regards
> Pramod
>
>
> John Bell wrote:
> > Hi
> >
> > You may want to start from these examples:
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> >
> > John
> >
> > "ipramod@.gmail.com" wrote:
> >
> > > Hi John,
> > >
> > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > event Id's and their description?
> > >
> > > Thanks for replying,
> > > Regards,
> > > Pramod Ingle
> > >
> > >
> > > John Bell wrote:
> > > > Hi
> > > >
> > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > or write your own xp.
> > > >
> > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > RAISERROR, but you will not have a great deal flexibility.
> > > >
> > > > John
> > > >
> > > > "ipramod@.gmail.com" wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > Event and the desc for that?
> > > > >
> > > > >
> > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > the same NT Event.
> > > > >
> > > > >
> > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > >
> > > > >
> > > > > Can anyone please let me know if its possible.
> > > > >
> > > > >
> > > > > Thanks in advance,
> > > > > Regards,
> > > > > Pramod
> > > > >
> > > > >
> > >
> > >
>|||Thanks John,
Actually I want to write SQLServer events to Application Log. Is there
any way to that?
Regards,
Pramod
John Bell wrote:
> Hi
> The last example show you almost everything that you need to do, it is not a
> great step to work out how to limit the sourcename by changing the where
> clause in the query or specifying specific EventCode values. If you can't
> then the following explains how to use WQL
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
> See also
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
> for more information on what the Win32_NTLogEvent class contains
> "ipramod@.gmail.com" wrote:
> > Hi John,
> >
> > The link you specified does not indicate how to get all event id's of a
> > registered source and also does not specify how to write events.
> >
> > Thanks for your suggestion. Expecting more help :-)
> >
> > Regards
> > Pramod
> >
> >
> >
> >
> > John Bell wrote:
> > > Hi
> > >
> > > You may want to start from these examples:
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> > >
> > > John
> > >
> > > "ipramod@.gmail.com" wrote:
> > >
> > > > Hi John,
> > > >
> > > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > > event Id's and their description?
> > > >
> > > > Thanks for replying,
> > > > Regards,
> > > > Pramod Ingle
> > > >
> > > >
> > > > John Bell wrote:
> > > > > Hi
> > > > >
> > > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > > or write your own xp.
> > > > >
> > > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > > RAISERROR, but you will not have a great deal flexibility.
> > > > >
> > > > > John
> > > > >
> > > > > "ipramod@.gmail.com" wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > > Event and the desc for that?
> > > > > >
> > > > > >
> > > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > > the same NT Event.
> > > > > >
> > > > > >
> > > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > > >
> > > > > >
> > > > > > Can anyone please let me know if its possible.
> > > > > >
> > > > > >
> > > > > > Thanks in advance,
> > > > > > Regards,
> > > > > > Pramod
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >|||Hi
Have you looked at RAISERROR or xp_logevent? Failing that you could call
xp_cmdshell with the a script that takes parameters.
John
"ipramod@.gmail.com" wrote:
> Thanks John,
> Actually I want to write SQLServer events to Application Log. Is there
> any way to that?
> Regards,
> Pramod
> John Bell wrote:
> > Hi
> >
> > The last example show you almost everything that you need to do, it is not a
> > great step to work out how to limit the sourcename by changing the where
> > clause in the query or specifying specific EventCode values. If you can't
> > then the following explains how to use WQL
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
> >
> > See also
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
> > for more information on what the Win32_NTLogEvent class contains
> >
> > "ipramod@.gmail.com" wrote:
> >
> > > Hi John,
> > >
> > > The link you specified does not indicate how to get all event id's of a
> > > registered source and also does not specify how to write events.
> > >
> > > Thanks for your suggestion. Expecting more help :-)
> > >
> > > Regards
> > > Pramod
> > >
> > >
> > >
> > >
> > > John Bell wrote:
> > > > Hi
> > > >
> > > > You may want to start from these examples:
> > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> > > >
> > > > John
> > > >
> > > > "ipramod@.gmail.com" wrote:
> > > >
> > > > > Hi John,
> > > > >
> > > > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > > > event Id's and their description?
> > > > >
> > > > > Thanks for replying,
> > > > > Regards,
> > > > > Pramod Ingle
> > > > >
> > > > >
> > > > > John Bell wrote:
> > > > > > Hi
> > > > > >
> > > > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > > > or write your own xp.
> > > > > >
> > > > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > > > RAISERROR, but you will not have a great deal flexibility.
> > > > > >
> > > > > > John
> > > > > >
> > > > > > "ipramod@.gmail.com" wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > > > Event and the desc for that?
> > > > > > >
> > > > > > >
> > > > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > > > the same NT Event.
> > > > > > >
> > > > > > >
> > > > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > > > >
> > > > > > >
> > > > > > > Can anyone please let me know if its possible.
> > > > > > >
> > > > > > >
> > > > > > > Thanks in advance,
> > > > > > > Regards,
> > > > > > > Pramod
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > >
> > >
>|||No, can you give me the link
Regards,
Pramod
John Bell wrote:
> Hi
> Have you looked at RAISERROR or xp_logevent? Failing that you could call
> xp_cmdshell with the a script that takes parameters.
> John
> "ipramod@.gmail.com" wrote:
> > Thanks John,
> >
> > Actually I want to write SQLServer events to Application Log. Is there
> > any way to that?
> >
> > Regards,
> > Pramod
> >
> > John Bell wrote:
> > > Hi
> > >
> > > The last example show you almost everything that you need to do, it is not a
> > > great step to work out how to limit the sourcename by changing the where
> > > clause in the query or specifying specific EventCode values. If you can't
> > > then the following explains how to use WQL
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
> > >
> > > See also
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
> > > for more information on what the Win32_NTLogEvent class contains
> > >
> > > "ipramod@.gmail.com" wrote:
> > >
> > > > Hi John,
> > > >
> > > > The link you specified does not indicate how to get all event id's of a
> > > > registered source and also does not specify how to write events.
> > > >
> > > > Thanks for your suggestion. Expecting more help :-)
> > > >
> > > > Regards
> > > > Pramod
> > > >
> > > >
> > > >
> > > >
> > > > John Bell wrote:
> > > > > Hi
> > > > >
> > > > > You may want to start from these examples:
> > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> > > > >
> > > > > John
> > > > >
> > > > > "ipramod@.gmail.com" wrote:
> > > > >
> > > > > > Hi John,
> > > > > >
> > > > > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > > > > event Id's and their description?
> > > > > >
> > > > > > Thanks for replying,
> > > > > > Regards,
> > > > > > Pramod Ingle
> > > > > >
> > > > > >
> > > > > > John Bell wrote:
> > > > > > > Hi
> > > > > > >
> > > > > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > > > > or write your own xp.
> > > > > > >
> > > > > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > > > > RAISERROR, but you will not have a great deal flexibility.
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > "ipramod@.gmail.com" wrote:
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > > > > Event and the desc for that?
> > > > > > > >
> > > > > > > >
> > > > > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > > > > the same NT Event.
> > > > > > > >
> > > > > > > >
> > > > > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > > > > >
> > > > > > > >
> > > > > > > > Can anyone please let me know if its possible.
> > > > > > > >
> > > > > > > >
> > > > > > > > Thanks in advance,
> > > > > > > > Regards,
> > > > > > > > Pramod
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >|||Hi
Both are documented in Books Online.
John
"ipramod@.gmail.com" wrote:
> No, can you give me the link
> Regards,
> Pramod
>
> John Bell wrote:
> > Hi
> >
> > Have you looked at RAISERROR or xp_logevent? Failing that you could call
> > xp_cmdshell with the a script that takes parameters.
> >
> > John
> >
> > "ipramod@.gmail.com" wrote:
> >
> > > Thanks John,
> > >
> > > Actually I want to write SQLServer events to Application Log. Is there
> > > any way to that?
> > >
> > > Regards,
> > > Pramod
> > >
> > > John Bell wrote:
> > > > Hi
> > > >
> > > > The last example show you almost everything that you need to do, it is not a
> > > > great step to work out how to limit the sourcename by changing the where
> > > > clause in the query or specifying specific EventCode values. If you can't
> > > > then the following explains how to use WQL
> > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/querying_with_wql.asp
> > > >
> > > > See also
> > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_nteventlogfile.asp
> > > > for more information on what the Win32_NTLogEvent class contains
> > > >
> > > > "ipramod@.gmail.com" wrote:
> > > >
> > > > > Hi John,
> > > > >
> > > > > The link you specified does not indicate how to get all event id's of a
> > > > > registered source and also does not specify how to write events.
> > > > >
> > > > > Thanks for your suggestion. Expecting more help :-)
> > > > >
> > > > > Regards
> > > > > Pramod
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > John Bell wrote:
> > > > > > Hi
> > > > > >
> > > > > > You may want to start from these examples:
> > > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp
> > > > > >
> > > > > > John
> > > > > >
> > > > > > "ipramod@.gmail.com" wrote:
> > > > > >
> > > > > > > Hi John,
> > > > > > >
> > > > > > > I am using SQL Server 2000. Is there any WMI Class that gives all the
> > > > > > > event Id's and their description?
> > > > > > >
> > > > > > > Thanks for replying,
> > > > > > > Regards,
> > > > > > > Pramod Ingle
> > > > > > >
> > > > > > >
> > > > > > > John Bell wrote:
> > > > > > > > Hi
> > > > > > > >
> > > > > > > > You don't say which version of SQL server you are using! With SQL 2005 you
> > > > > > > > can use SSIS to do this, alternatively you could write your own WMI scripts
> > > > > > > > or write your own xp.
> > > > > > > >
> > > > > > > > To write to the event log you can use xp_logevent, or the LOG option of
> > > > > > > > RAISERROR, but you will not have a great deal flexibility.
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > "ipramod@.gmail.com" wrote:
> > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > Is it possbile to retrieve all the Event Id's of a registerd source
> > > > > > > > > (Ex. MSSQLSERVER)? If it possible then can we retrieve the description
> > > > > > > > > of those Event Id's and can we generate the NT Event with the above NT
> > > > > > > > > Event and the desc for that?
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Some how I retrieve all the Event Id's of SQL Server application and
> > > > > > > > > then for each Event ID retrieve the Event Id Description and gererate
> > > > > > > > > the same NT Event.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > SMGENIE.EXE from MS Resource kit do the same.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Can anyone please let me know if its possible.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Thanks in advance,
> > > > > > > > > Regards,
> > > > > > > > > Pramod
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > >
> > >
>