SQL Server 2012 Auditing

I am trying to see what is causing an application connection to switch databases once connected. The custom app I have is to write to any database that I type into it with the designated credentials. When I connect to the SQL Server instance, I have a db1 and a db1_dev. I want to write to the db1_dev when connecting with the app, and the app does successfully connect, but then it writes to table1. I tested the app by entering a database name that doesn't exist and then it doesn't connect....so that indicates to me that the app is initially passing in the database name value that I am giving it, however somewhere in SQLServer 2012, it is defaulting back to db1. What can be done to troubleshoot the SQL Server to see what is causing the issue?
LVL 1
DB-ahaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Mark WillsConnect With a Mentor Topic AdvisorCommented:
Sounds a bit like the remnants of a previous connection has become hard coded.

What language are you using and we can add those Topic Areas to your question and get some developer help.
0
 
TempDBAConnect With a Mentor Commented:
Check the code what you are using for writing into the table, but not the connection string. I think in the insert statement, you have older database name hardcoded. Or if you are trying to insert via a view\stored procedure which inturn is pointing to the old database.
0
 
DB-ahaConnect With a Mentor Author Commented:
Thanks for the advice, however I had no access to the application to be able to review it myself, I simply had only access to the database. What was required on my end was to open SQL Profiler and view the queries sent by the application. When doing so I was able to identify that the insert statement contained what appeared to be hard coded database. The application developer then looked at the queries and changed the database name in the application into a variable.
0
 
DB-ahaAuthor Commented:
My comment contains what was actually done to troubleshoot. While the other comments provided did not provide ant SQL Troubleshooting techniques.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.