Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to Audit SQL Execution?

4 posts in General Discussion Last posting was on 2011-04-14 12:54:17.0Z
hyjshanghai Posted on 2011-04-09 05:33:00.0Z
Sender: 1e72.4d9fedb1.1804289383@sybase.com
From: hyjshanghai@gmail.com
Newsgroups: sybase.public.ase.general
Subject: How to Audit SQL Execution?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4d9fef8c.1e92.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 8 Apr 2011 22:33:00 -0700
X-Trace: forums-1-dub 1302327180 10.22.241.41 (8 Apr 2011 22:33:00 -0700)
X-Original-Trace: 8 Apr 2011 22:33:00 -0700, 10.22.241.41
Lines: 19
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30099
Article PK: 79328

When we execute a SQL or a stored procedure, we will be told
how many rows are affected by it.
However, how can we know which rows in the table / view are
affected?

We are developing an application who executes SQL to
manipulate sensitive data.

We want to know which rows of the data are affected by the
SQL.

To be even better, we want to make backup of the rows to be
updated by the SQL, so that we can revert to the state
before the SQL is executed, if our SQL logic is wrong.

How would you implement such auditing over SQL execution in
a way that is generic and automatic?

(We are using Sybase ASE 12.5.4.)


Sherlock, Kevin [TeamSybase] Posted on 2011-04-11 16:55:40.0Z
From: "Sherlock, Kevin [TeamSybase]" <kevin.sherlock@teamsybase.com>
Newsgroups: sybase.public.ase.general
References: <4d9fef8c.1e92.1681692777@sybase.com>
Subject: Re: How to Audit SQL Execution?
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4da3328c$1@forums-1-dub>
Date: 11 Apr 2011 09:55:40 -0700
X-Trace: forums-1-dub 1302540940 10.22.241.152 (11 Apr 2011 09:55:40 -0700)
X-Original-Trace: 11 Apr 2011 09:55:40 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30104
Article PK: 79330

If you simply wish to preserve the before image of a row or rows prior to an
update taking place, simply place an update trigger on the table which is
coded to copy the before image of the row(s) to an "archive" table.

<hyjshanghai@gmail.com> wrote in message
news:4d9fef8c.1e92.1681692777@sybase.com...
> When we execute a SQL or a stored procedure, we will be told
> how many rows are affected by it.
> However, how can we know which rows in the table / view are
> affected?
>
> We are developing an application who executes SQL to
> manipulate sensitive data.
>
> We want to know which rows of the data are affected by the
> SQL.
>
> To be even better, we want to make backup of the rows to be
> updated by the SQL, so that we can revert to the state
> before the SQL is executed, if our SQL logic is wrong.
>
> How would you implement such auditing over SQL execution in
> a way that is generic and automatic?
>
> (We are using Sybase ASE 12.5.4.)


Sherlock, Kevin [TeamSybase] Posted on 2011-04-11 17:04:58.0Z
From: "Sherlock, Kevin [TeamSybase]" <kevin.sherlock@teamsybase.com>
Newsgroups: sybase.public.ase.general
References: <4d9fef8c.1e92.1681692777@sybase.com> <4da3328c$1@forums-1-dub>
Subject: Re: How to Audit SQL Execution?
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4da334ba$1@forums-1-dub>
Date: 11 Apr 2011 10:04:58 -0700
X-Trace: forums-1-dub 1302541498 10.22.241.152 (11 Apr 2011 10:04:58 -0700)
X-Original-Trace: 11 Apr 2011 10:04:58 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30106
Article PK: 79335

never mind. I see that you already posted this question in the
"backup+recovery" newsgroup. Please don't post the same question to
multiple threads.

"Sherlock, Kevin [TeamSybase]" <kevin.sherlock@teamsybase.com> wrote in
message news:4da3328c$1@forums-1-dub...
> If you simply wish to preserve the before image of a row or rows prior to
> an update taking place, simply place an update trigger on the table which
> is coded to copy the before image of the row(s) to an "archive" table.
>
> <hyjshanghai@gmail.com> wrote in message
> news:4d9fef8c.1e92.1681692777@sybase.com...
>> When we execute a SQL or a stored procedure, we will be told
>> how many rows are affected by it.
>> However, how can we know which rows in the table / view are
>> affected?
>>
>> We are developing an application who executes SQL to
>> manipulate sensitive data.
>>
>> We want to know which rows of the data are affected by the
>> SQL.
>>
>> To be even better, we want to make backup of the rows to be
>> updated by the SQL, so that we can revert to the state
>> before the SQL is executed, if our SQL logic is wrong.
>>
>> How would you implement such auditing over SQL execution in
>> a way that is generic and automatic?
>>
>> (We are using Sybase ASE 12.5.4.)
>
>


hyjshanghai Posted on 2011-04-14 12:54:17.0Z
Sender: e7e.4da6edf1.1804289383@sybase.com
From: hyjshanghai@gmail.com
Newsgroups: sybase.public.ase.general
Subject: Re: How to Audit SQL Execution?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4da6ee79.e93.1681692777@sybase.com>
References: <4da334ba$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Apr 2011 05:54:17 -0700
X-Trace: forums-1-dub 1302785657 10.22.241.41 (14 Apr 2011 05:54:17 -0700)
X-Original-Trace: 14 Apr 2011 05:54:17 -0700, 10.22.241.41
Lines: 40
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30108
Article PK: 79338

I apologize for that.
I will not do it again.
You may delete this thread if you can.

> never mind. I see that you already posted this question
> in the "backup+recovery" newsgroup. Please don't post
> the same question to multiple threads.
>
> "Sherlock, Kevin [TeamSybase]"
> <kevin.sherlock@teamsybase.com> wrote in message
> > news:4da3328c$1@forums-1-dub... If you simply wish to
> > preserve the before image of a row or rows prior to an
> update taking place, simply place an update trigger on the
> > table which is coded to copy the before image of the
> row(s) to an "archive" table. >
> > <hyjshanghai@gmail.com> wrote in message
> > news:4d9fef8c.1e92.1681692777@sybase.com...
> >> When we execute a SQL or a stored procedure, we will be
> told >> how many rows are affected by it.
> >> However, how can we know which rows in the table / view
> are >> affected?
> >>
> >> We are developing an application who executes SQL to
> >> manipulate sensitive data.
> >>
> >> We want to know which rows of the data are affected by
> the >> SQL.
> >>
> >> To be even better, we want to make backup of the rows
> to be >> updated by the SQL, so that we can revert to the
> state >> before the SQL is executed, if our SQL logic is
> wrong. >>
> >> How would you implement such auditing over SQL
> execution in >> a way that is generic and automatic?
> >>
> >> (We are using Sybase ASE 12.5.4.)
> >
> >
>
>