SQL Login currently in use or not Recently we did a change on a client's production server. The change was to rename an sa login. Once we renamed the sa login we found out the client was having a problem because sa login was used in the connection string for a few applications which the client didn't mentioned to us. We were able to roll back the rename.

In the future, is there any way or query which we can execute so that we can know if sa login is currently used by any application or user before we renamed it or delete the login? Basically we want to check if any login is actively used by anyone before renaming or deleting it.
You run a server-side trace or Extended Event session to capture login activity.

I also would not have just renamed it in production. If you are referring to the sa account itself, disable it first to verify if anything breaks; and leave that disabled for a day or up to a week. How long you leave it is based on knowledge by the application owner. If they are not confident leave it disabled for at least a month.

If you are renaming just any old login to something else for a purpose, you obviously cannot go with the disable route. In that case you just have to let your trace run for a period of time to capture the activity.

One other option you might try is to just put in a server trigger that just writes an audit of login activity. There are a few examples of this on the web.