0

How to get historical run details for a stored procedure with parameters values in a run for a SQL Server database?

For ex. if the sp_getcustomerbyid stored procedure is run in the database earlier with parameter 5, i.e sp_getcustomerbyid 5, I need this information.

How do we get this complete information sp_getcustomerbyid 5? It s not a duplicate, we don't have answers for fetching parameters.

Vishwas S L
  • 169
  • 1
  • 8
  • Possible duplicate question of [https://stackoverflow.com/questions/5299669](https://stackoverflow.com/questions/5299669/how-to-see-query-history-in-sql-server-management-studio)? – etch_45 Aug 07 '20 at 14:22
  • 1
    Side note: you should **not** use the `sp_` prefix for your stored procedures. Microsoft has [reserved that prefix for its own use (see *Naming Stored Procedures*)](http://msdn.microsoft.com/en-us/library/ms190669%28v=sql.105%29.aspx), and you do run the risk of a name clash sometime in the future. [It's also bad for your stored procedure performance](http://www.sqlperformance.com/2012/10/t-sql-queries/sp_prefix). It's best to just simply avoid `sp_` and use something else as a prefix - or no prefix at all! – marc_s Aug 07 '20 at 14:24
  • Am exactly looking for stored procedure and not query. Sp with parameters – Vishwas S L Aug 07 '20 at 14:25

0 Answers0