I want to find which database is querying from, here is my output:
EXEC sp_example @stat = N'SELECT stat FROM [dbo].[statsUSers] AS [UserStats];
What I want is like this:
EXEC sp_example @stat=N'SELECT stat FROM [MyOwnDataBase].[statsUSers] AS [UserStats];
I've already tried this tip: SQL Server Profiler - how do I find which database is being connected?
but still it's [dbo]
and not showing the name of the database.
Question
How can I access name of database?
I don't want [dbo]
changes to something meaningless - I want the actual name of database.