SP_Who 不返回 DBName 列

发布于 2024-08-19 06:22:16 字数 286 浏览 2 评论 0原文

我的 Delphi 应用程序通过 BDE 连接到 SQL Server 数据库。
在此过程中,我的应用程序查询 SP_Who 存储过程以获取 DbName 列值。但现在我想通过 ODBC 将我的应用程序连接到 SQL Server 数据库。

我为此使用 SQL Server Native 客户端驱动程序,但是当我的应用程序查询 SP_Who 但该过程不返回 DBName 列时。这是为什么呢?在这种情况下如何获取 DBName 的值?是否有任何其他过程来获取 DBName 列值。

My Delphi application connects to a SQL Server Database through BDE.
In the process, my application queries SP_Who stored procedure to get the DbName column Value. But now I want to connect my application through ODBC to the SQL Server database.

I'm using the SQL Server Native client driver for this, but when my application queries SP_Who but the procedure does not return the DBName Column. Why is this? How can I get the value of DBName in this case? Is there any other procedure to obtain the DBName column value.

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

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

发布评论

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

评论(1

-柠檬树下少年和吉他 2024-08-26 06:22:17

您可以使用以下方法获取数据库名称:

SELECT DB_NAME()

您是否获得运行 sp_who2 的 DBName 列?

You can obtain the database name using:

SELECT DB_NAME()

Do you get the DBName column running sp_who2 ?

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