简体   繁体   中英

Find out the SP due to which the columns of tables are updated

I have the database in which two columns of the tables are updated, but i dont know which SP is executing to update those columns. how can i find out the SP due to which the columns of tables are updated???? Thanks in advance.

Thanks to your comment clarifying the database you are using, I will suggest installing a tool like RedGate's SQL Search, which is free. Use it to search through your stored procs for the name of the column, and find the code where the update is occurring.

If you cannot deduce which proc is doing the update then you will have to add some logging mechanisms as suggested by gilly3. Perhaps add new columns such as LastUpdateTime and LastUpdateProc, and add code in all procs to update these columns. Additionally, your procs can track their start/stop times by writing to another table meant for tracking proc execution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM