1

I am a beginner level programmer who was assigned to update the data content in UI. this UI references a database table so I went ahead and began updating the table as per constraints. I had a backup of the data taken and had the create construct imported as well before running the modification queries on SQL Server Management Studio 2008.

A misleading update statement corrupted the table when it updated the whole database instead of 4 rows and I could not pin point to what data ended up being modified and what remained same. Long story short, I had to delete the records and eventually drop the table and then reconstruct it also. Everything went well, I recreated the schema and inserted the data from the backup and continued querying.

However, the UI which was populating its display section from my table went all blank after the incident and I am at a loss to know where is it exactly that I went wrong. It is a small database and this table was NOT referencing any other table. The permissions look good as it was before. I can't really understand what has gone wrong. Queries work well.

If you have had the patience to read my tediously long narrative till now, can you please tell me what is it that I am missing here ?!

I apologize for the overdrawn description but the context felt more important than the problem statement itself.

  • Do you know the queries that the UI sends? If not you can use Profiler to see them. Once you know them try in management studio against the database and a restored database from your backup copy and see if you can figure it out from there (or provide some additional info to your question if not) – Martin Smith Jun 27 '13 at 16:22
  • What is the programming language for your UI? – Dan Bracuk Jun 27 '13 at 16:38
  • Too late now, but next time take a backup of the database itself, not just the data. Run a simple query on your table, make sure it has data, then start debugging the UI and see how it is getting it's data. That's the best I can offer given the description. Good Luck. – Mike C. Jun 27 '13 at 16:42
  • Dan,The UI is a simple combination of HTML and ASP code. The database is minimalist in itself, not many complicated dependencies or constraints. Martin, The queries used by the UI is mostly to only retrieve the records, select with certain conditions. I'll try the profiler and see if I skipped anything important. Mike , Sigh. I will continue doing that. Hope I figure it out. What I want to know essentially is did I miss any step in recreating the table which might be affecting the UI ? Should I have had to rebuild the index (although I don't see why it is necessary) or something else ? – SoumyaMurthy Jun 27 '13 at 17:13
  • Do you see any exceptions? – John Tseng Jun 28 '13 at 00:00
  • All, it got sorted out! for all my extensive research on what was going wrong, I failed to see that a simple read permission was missing for the table after I restored it. Thanks for the inputs, I am going to have to be careful to verify the permissions from now but most importantly, never mess with the actual table so much that I end up dropping it! – SoumyaMurthy Jun 28 '13 at 04:48

0 Answers0