Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Monday, March 26, 2012

How to get the name of the database currently connected to?

I have an application which connects to a sql server database thru a SQL
Server ODBC driver. In the application, I have a database componenet with
its aliasname name set to the name of the ODBC driver. I have several
databses on the server and I need to know if I can get the actual name of
the database I am connecting to?Sam,
Try:
SELECT DB_NAME()
HTH
Jerry
"Sam" <Sam@.discussions.microsoft.com> wrote in message
news:F29D0818-2376-432D-B8AE-F8A734A8199F@.microsoft.com...
>I have an application which connects to a sql server database thru a SQL
> Server ODBC driver. In the application, I have a database componenet
> with
> its aliasname name set to the name of the ODBC driver. I have several
> databses on the server and I need to know if I can get the actual name of
> the database I am connecting to?|||SELECT DB_NAME()
David Portas
SQL Server MVP
--
"Sam" <Sam@.discussions.microsoft.com> wrote in message
news:F29D0818-2376-432D-B8AE-F8A734A8199F@.microsoft.com...
>I have an application which connects to a sql server database thru a SQL
> Server ODBC driver. In the application, I have a database componenet
> with
> its aliasname name set to the name of the ODBC driver. I have several
> databses on the server and I need to know if I can get the actual name of
> the database I am connecting to?|||Try:
select db_name()
go
AMB
"Sam" wrote:

> I have an application which connects to a sql server database thru a SQL
> Server ODBC driver. In the application, I have a database componenet wit
h
> its aliasname name set to the name of the ODBC driver. I have several
> databses on the server and I need to know if I can get the actual name of
> the database I am connecting to?|||Thanks :)
"David Portas" wrote:

> SELECT DB_NAME()
> --
> David Portas
> SQL Server MVP
> --
> "Sam" <Sam@.discussions.microsoft.com> wrote in message
> news:F29D0818-2376-432D-B8AE-F8A734A8199F@.microsoft.com...
>
>

Wednesday, March 7, 2012

How to get ODBC working with MSDE

Hi,
yes thanks .. but I did figure that out by myself.
SQLServer is running, I am able to osql on it ...
but ODBC refuses connectivity.
Maybe I just forgot something else.

>please have a look at
>http://support.microsoft.com/default...&Product=sql2k
You could checkout if your network protocols are on or not. OSQL may be
using shared memory connection here so it may be working properly.
KB article http://support.microsoft.com/?id=827204