Track asp pages that are deleting records from a table

  • We have a website that has thousands of asp and asp.net pages. One of the pages has been written to do a deletion of records on a specific table. We know the table the records are being deleted from, the stored procedure that is doing the deletion, but don't know the asp page calling the stored procedure.

    Is there a way of doing a trace or change tracking (for the specific table) or delete trigger that captures the asp page name that is calling the deletion?

  • Why not just search the website directories for the name of the stored proc? Unless you have done something to the connection string, or pass a value to a stored proc, there is no way sql will be able to tell one page from another. The pages will all use the same connection.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange (4/12/2013)


    Why not just search the website directories for the name of the stored proc? Unless you have done something to the connection string, or pass a value to a stored proc, there is no way sql will be able to tell one page from another. The pages will all use the same connection.

    agreed; every page would need to be modified just to be sure to send information to SQL server so SQL could see which page it was...so it's much easier to look at the source of the problem (search the web pages)

    That which page did it kind of info does not exist at all on the SQL server side.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Ok. Thank you. I was hoping for some cool way at the database level to do it. The text search of webpages takes a long time to complete as there are so many. It looks like that's the way to do it though.

  • hmbmeister (4/12/2013)


    Ok. Thank you. I was hoping for some cool way at the database level to do it. The text search of webpages takes a long time to complete as there are so many. It looks like that's the way to do it though.

    It really is the only way you can do this type of thing. It can take some time if you have tons of files which it sounds like you do. You might need to either copy all the files somewhere or do your search at an off time so you don't kill your server and subsequently your site while the search is happening.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply