遗憾的是,我们通过 SQL 查询中的内联注释进行审计,如下所示:
begin transaction;
EXEC someStoredProcedure; --this was executed by Bob
commit transaction;
我试图通过制作一个带有用户输入字段的工具来自动化它。有没有办法在评论变量中创建字符串,像这样?
DECLARE @username varchar(50);
begin transaction;
EXEC someStoredProcedure; --this was executed by @username
commit transaction;