I need to know if there is any way to find out if a table is being queried by some other process in SQL Server.
I am trying to Merge Empty Partitions on a table, and that table is being queried by many process. So, i need to check if the table is being read/insert by other process,if yes than my merge operation will not proceed. Because if it runs then it gets locked and fails over time. Due to which sometimes i run out of partitions or i have to run it manually.