It looks like Database Name field in Active Session table always contains the same value, which is obviously database name. Is that correct?
If so, would it be consistent to get the first (or any other) record from this table to read the database name and use it, say, in MESSAGE?
0
Comments
If yes, then I check it that it will contain the real DB Name (which can vary per user), instead of 1 DB Name value.
Use the recommendation by
Andwian
Honestly I'm not well aware about the differences but consider that in Active Session there are also NAS sessions and this means a small chance of error retrieving the right record; otherwise with Session table there will be just one row.