0

I have a temp table that is affected by various Stored procedures and wanted to know what the latest SP that affected the table and when.

There is some internal log or query that can bring me an approximate result in SQL server?

Ex:

Here Temporary_summ is my table and below is the format i am expecting..

 tablename            spname              lastaccessedtime
temporary_summ --- sp_math_cal --------- 2016-05-30 12:05:22

temporary_summ --- sp_weather_calc ---- 2016-05-30 12:06:34
TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
J.Sperandio
  • 87
  • 1
  • 10
  • Don't you think that would be an incredible amount of overhead to impose on all people implementing SQL Server databases, just on the off chance that someone will want this data? And then think about other pieces of data that *some* people might also want included, beyond what *your* requirements are. Should everyone be penalised for every possible meta-query that anyone might want to write in the future? In general, if you want something in SQL, you have to implement it and explicitly pay the price. – Damien_The_Unbeliever Jun 27 '16 at 14:53
  • I agree, but in this case I think the re-use , if a User start a SP and the same is the last run I do not need execute she, only recovery the data, which was my initial idea – J.Sperandio Jun 29 '16 at 11:36

1 Answers1

1

You can capture the activity on a server using SQL Server Profiler.

It creates a log since you start running it. It is just for capture when needed (Ex.: debugging), so it doesn't consume the server resources.

enter image description here

Edu
  • 2,354
  • 5
  • 32
  • 36
  • Did not know this feature, thanks for the tip , however I can do this using sql ? – J.Sperandio Jun 29 '16 at 11:37
  • This might help: http://stackoverflow.com/questions/5299669/how-to-see-query-history-in-sql-server-management-studio – Edu Jun 29 '16 at 13:51