I have an unknown sql database and I need to know what application it belongs too.

Posted on 2011-10-05
Last Modified: 2012-05-12
What query can I run to determine what application is using this database if any? Or what application created the database?

Question by:slmccullough
    LVL 25

    Expert Comment

    sql trace and you can see what's connecting to that database from where.
    Name off database, the tables it contains .... can also tell you a lot. Or the users that have been granted access.

    And if not ... prevent the database off being used (read only, offline ....) and wait for the errors and people to complain.  But that's not a nice way to do if you realy don't have a clue if it's important and when it's on production.

    Author Comment


    So, what type of query can I run against the database that will give me the information I need inside the table or tables? Or even the headings... The dbo owner is the same for all the databases. It seems to be some type of archiving but really not sure.

    Any ideas (or suggestions) of queries I can run to help me figure this out would be great. Like: what application created it? Or when was the last time it changed something? Whatever it has created several of the same kind of databases but in increments of _01, _02, _03 and etc...

    Thanks for any inputs....
    LVL 12

    Expert Comment

    by:Ramkisan Jagtap
    LVL 32

    Expert Comment

    by:Daniel Wilson
    Try the query:


    That will tell a lot about what application & login are connecting to what databases.  Beyond that, jogos is right -- SQL Profiler will show you a lot.  Maybe more than you need to see, depending on activity levels.  But ... you might just watch the Login activity in SQL Profiler.  That might tell you enough.
    LVL 25

    Accepted Solution

    exec sp_helpdb -> tells you when db's are created

    In management studio you can open the database, see which tables are in it and even show the content of that table.


    Author Closing Comment


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now