使用 SQL Server 2000 监视和更改 SQL 查询

发布于 2024-09-06 18:22:16 字数 281 浏览 1 评论 0原文

我有一个行为异常的数据库升级工具。我想捕获它发送到数据库的查询之一并在执行之前对其进行更改。

该工具通过 ODBC 连接。

该工具和 SQL Server 位于同一个 Windows 2003 Server 机器上。

有什么想法吗?

编辑:(更多信息) 当该工具运行时,它会在 100 步中的第 12 步处终止。它会发出一些旨在创建视图的错误 SQL。我需要在执行之前抑制错误消息或更正 SQL。我不能只创建视图,因为它做的第一件事就是删除视图。即使这样它也会出错,因为视图已经存在。

I have a database upgrade tool that is misbehaving. I would like to catch one of the queries it sends to the database and change it before it is executed.

The tool connects via ODBC.

The tool and the SQL Server are on the same Windows 2003 Server box.

Any ideas?

EDIT: (More info)
When the tool runs it dies on step 12 out of 100. It issues some bad SQL intended to create a view. I need to suppress the error message or correct the SQL before it is executed. I can't just create the view because the first thing it does it drop the view. Even then it would error because the view would already exist.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兲鉂ぱ嘚淚 2024-09-13 18:22:16

当然可以 - 使用 SQL Profiler 拦截并记录查询。

非常有用的小工具,...

Certainly - use the SQL Profiler to intercept and record the query.

Very useful little tool that...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文