English 中文(简体)
是否有办法发现提交Kingk询问的用户?
原标题:Is there a way to find out the user that submitted a SQL query?

我有兴趣撰写一个触发点,它将忽视具体用户的询问,但对所有其他用户采取行动。 是否有办法这样做?

不过,一份说明:用户需要做一些询问,因此,我需要允许某些查询/删除/提盘。

最佳回答

如果你现在有一个触发点,即你不想火灾(我们在转移大量数据时就在审计触发点这样做),那么你可以在触发点开始时做这样的事:

if (suser_sname() =  somename ) return

如果你想要做一些事情,那么你会做这样的事情:

if (suser_sname() =  somename) 
BEGIN
    some code
END
ELSE
BEGIN
    someother code
END

就此指出几个问题。 谨慎使用该守则,。 首先,如果你可以通过安全权利来做你所需要的,那就是一个更好的选择。 如果有人把自己的名字打成一个触发点的话,那么在你忘记了你在那里的时候,就会产生奇怪的结果。 如果你在短期内需要这样做(将1亿 000 000万份批量记录及时移至数据库,而不打上例如洗 au机),那么当项目完成时,就不要忘记加以改变。 你们不想审计某人的行动,特别是如果审计金融交易的话。 此外,在触发因素中做一些事情只会有助于插入/更新日期/模板。 我们不能阻止选择触发点。

问题回答

仅仅调整他们的特权,使之不包含选择和你想要阻止他们做什么。

• 如何在电离层电离层中构造像:

If USER <> [your case]
Begin
  Do Stuff
End




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

难以执行 REGEXP_SUBSTR

I m 查询Oracle 10g。 我有两张表格(样本数据见下文)。 i m 试图提取一些领域

SQL Query Shortcuts

What are some cool SQL shorthands that you know of? For example, something I learned today is you can specify to group by an index: SELECT col1, col2 FROM table GROUP BY 2 This will group by col2

PHP array callback functions for cleaning output

I have an array of output from a database. I am wondering what the cleanest way to filter the values is example array Array ( [0] => Array ( [title] => title 1 ...

OracleParameter and DBNull.Value

we have a table in an Oracle Database which contains a column with the type Char(3 Byte). Now we use a parameterized sql to select some rows with a DBNull.Value and it doesn t work: OracleCommand ...

Running numbers in SQL

I have a SQL-statement like this: SELECT name FROM users WHERE deleted = 0; How can i create a result set with a running number in the first row? So the result would look like this: 1 Name_1 2 ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签