2

I ran a large query (~30mb) which inserts data in ~20 tables. Accidentally, I selected wrong database. There are only 2 tables with same name but with different columns. Now I want to make sure that no data is inserted in this database, I just don't know how.

2
  • use permissions to prevent accidentally inserting in wrong DB Commented May 3, 2011 at 10:09
  • This is why all databases should have audit tables! Commented May 3, 2011 at 12:53

2 Answers 2

1

If your table has a timestamp you can test for that.

Also sql-server keeps a log of all transactions.

See: https://web.archive.org/web/20080215075500/http://sqlserver2000.databases.aspfaq.com/how-do-i-recover-data-from-sql-server-s-log-files.html

This will show you how to examine the log to see if any inserts happened.

Sign up to request clarification or add additional context in comments.

Comments

0

Best option go for Trigger

Use trigger to find the db name and table name and all the history of records manipulated

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.