[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

SQL 2005 active database

Posted on 2014-12-18
2
Medium Priority
?
98 Views
Last Modified: 2014-12-22
I have two databases configured with similar names. An application on my network communicates with one of the databases. I want to identify which one without looking at the client side. Is there anything I can view in SQL 2005 that will tell me which one is the active one. thanks
0
Comment
Question by:Sid_F
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
ste5an earned 2000 total points
ID: 40506758
No.

But you can use  
SELECT  C.session_id ,
        C.connect_time ,
        C.net_transport ,
        C.protocol_type ,
        C.client_net_address ,
        C.client_tcp_port ,
        C.local_net_address ,
        C.local_tcp_port ,
        C.connection_id ,
        C.parent_connection_id ,
        S.spid ,
        S.blocked ,
        S.status ,
        S.sid ,
        S.hostname ,
        S.program_name ,
        S.hostprocess ,
        S.cmd ,
        S.nt_domain ,
        S.nt_username ,
        S.net_address ,
        S.net_library ,
        S.loginame 
FROM    sys.dm_exec_connections C
        INNER JOIN sys.sysprocesses S ON C.session_id = S.spid;

Open in new window

to see who's connected to your database(s).
0
 
LVL 52

Expert Comment

by:Vitor Montalvão
ID: 40506786
I have two databases configured with similar names.
In the same instance? That's impossible.
Please clarify where those two databases are.

I want to identify which one without looking at the client side.
Assuming that the databases with the same name are in different instances, you need to connect to each instance and run the command sp_who2. This stored procedure returns all connections to the respective instance and has information about the user, application and the client computer that is connecting.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question