473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connected to which database

Hello all,

I have a scripts which needs the information about the database in
which it is running.

How can I find out this information.

For example if I want to know the User who has satrted this report, I
use the SYSTEM_USER procedure.

Does an equal procedure exist to find out, on which database the user
is connected to.

Regrads
Franz-Josef
Jul 20 '05 #1
1 1420
You can the name of the current database with DB_NAME():

SELECT DB_NAME()

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Franz-Josef" <Po**@tophoven. net> wrote in message
news:a0******** *************** ***@posting.goo gle.com...
Hello all,

I have a scripts which needs the information about the database in
which it is running.

How can I find out this information.

For example if I want to know the User who has satrted this report, I
use the SYSTEM_USER procedure.

Does an equal procedure exist to find out, on which database the user
is connected to.

Regrads
Franz-Josef

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1376
by: Franz-Josef | last post by:
Hello all, I have a scripts which needs the information about the database in which it is running. How can I find out this information. For example if I want to know the User who has satrted this report, I use the SYSTEM_USER procedure.
15
2712
by: Hi5 | last post by:
Hi, I am designing a database for a client in which It has a client table including the followings: 1-Table Client 2-Table lookupcategory 3-Table Ctegory
0
5771
by: ʹÃûÑï | last post by:
ORA-03114: not connected to ORACLE && MS's Bug?? DataBase:Oracle 817 using OracleClient,net framework 1.1 I'm using ADO.Net in C# with Oracle 817. and following is my public data access class. using System.Data.OracleClient;
4
2314
by: Steve Le Monnier | last post by:
The ADO.NET DataSet is idea for application development, especially if you need disconnected data. DataReader objects are great in the connected environment but are forward only. What do you do when you want a connected application but need the ability scroll forward and backward within the result set. What I'm trying to achieve is to build an application that has navigation buttons, thus allowing the user to step forward or backward...
2
2311
by: Robert Scheer | last post by:
Hi. My site needs to know if the user is connected before executing some queries on my database. Actually, I have a page loaded by an Iframe that runs every 30 seconds and updates a field on my database to tells me the user is connected. If this field is not updated for more than one minute I consider the user disconnected. The problem is, if that page does not load for any anormal reason (an IIS error like Page Could not be Loaded,...
1
1943
by: dejavue82 | last post by:
Hello fellow programmers! My question concerns the scalability of database access. In coldfusion (or php for that matter) for example, there seems to be only the connected model for accessing a DB. On the other hand, there is asp.net 2.0, which provides disconnected and connected access. Question: Would databinding to controls directly, in ASP.NET 2.0 (without the manual coding of ADO.net), be as affective (scalable) as using the...
5
12258
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected to the database. SQLSTATE=57030. Background: I created a linked server to DB2 8.1 database which called GRR_DB2Server. In my stored procedure p_FetchRawData, I need to read some data from this linked server GRR_DB2Server and insert them into
0
1283
by: Hetal | last post by:
Hi.. I have a VB.NET (Windows forms) application and i would like to determine the type of database (SQL/MySQL/Access) i am connected to. In native VB6, say i have a connection object named cntDB, doing "cntDB.Properties(x)" will provide me with the type of database i am connected to. Here is a sample code from native vb6 application that provides me the database type:
2
3322
by: Gabriel | last post by:
Hello, I'm looking for documentation with "Best Practice" for ASP.NET application In which case use Connected or Disconnected mode Typed dataset or not ? I didn'd find anything pertinent ....
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.