query needed

  • in one of my application I need to find the deleted site information from the database, how can I find ?

  • Huh?

    If data has been deleted, it's gone. Or are you referring to a table which has an 'IsDeleted' column or similar.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You probably have a "sites" table. If the row is not there, it must have been deleted or it has never been there. If you have a "deleted" attribute on the row, it could help you determine which case you're facing.

    We're not over your shoulder and cannot see your monitor, so please post some more information if you want precise answers.

    -- Gianluca Sartori

  • yes I have a sites table need a query to capture the deletion information ?

  • I still have no idea what you're trying to do.

    We're not sitting in your office, we can't see your screen, we don't know what you're trying to achieve unless you say so and we can't read your mind.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • We need to capture the deletion information from the table , we restored the last month backup to capture the data .

    we have a table sites where the data is stored . I need a query to get who deleted the data by using the columns id and deletion time from the table ?

  • Ask yourself whether you could solve the problem with that little information....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • im not expert in queries , iam looking is any sample query to do this ?

  • Since I still have no idea what you're trying to do, maybe.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Let's see if I can rephrase your question:

    Question:

    I have a table named "sites" with the following definition:

    CREATE TABLE sites (

    id int PRIMARY KEY,

    description varchar(200) NOT NULL

    )

    Somebody deleted some sites from this table.

    We restored a backup from last month and the data was there.

    I want to know when the rows were delete and who did it.

    Answer: you can't. If you don't track deletes with an audit, there's no way to know.

    Is this what you mean?

    -- Gianluca Sartori

  • If you don't have any sort of auditing set up on your server, you won't be able to see who deleted data. You can set up Audit within SQL Server. There are also third party tools that do this. Finally you can look to setting up extended event[/url]s to monitor for delete statements against this one table. But, all that will have to be set up. Nothing monitors and audits SQL Server by default out of the box.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • thanks for the info , yes whether it is possible to track the info

  • thanks for the info , yes whether it is possible to track the info

Viewing 13 posts - 1 through 12 (of 12 total)

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