October 19, 2010 at 4:13 pm
Cldewar (10/19/2010)
LutzM (10/19/2010)
Cldewar (10/19/2010)
How about data disappeared from my table and there are no deletes in any of my procedure. What could have done this?I encountered a problem where the delete was run against the wrong table. Took forever to find that one.
Please don't hijack a thread.
If you have a question, open a new thread and ask.
Gail asked why anyone would ask this. This is my suggestion. I do not have any questions.
Your suggestion is somewhat contradictory:
Either you have no deletes in any of your procs against this table or there is a proc with a delete against the (wrong) table. A possible reason would be a ad-hoc delete.
But in any case we'd talk about a delete statement.
There are ways to hide any trace of an ad-hoc delete if you just have proper permissions and the skills required...
October 19, 2010 at 7:56 pm
LutzM (10/16/2010)
Before going any further I'd like to know the true reason why you don't use the simple DELETE statement.
Well... imagine we are in the year 2030 and Microsoft is licensing by the statement being "DELETE" one of the most expensive ones 😀
Most certainly that was an interview question.
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.October 20, 2010 at 10:22 am
PaulB-TheOneAndOnly (10/19/2010)
LutzM (10/16/2010)
Before going any further I'd like to know the true reason why you don't use the simple DELETE statement.Well... imagine we are in the year 2030 and Microsoft is licensing by the statement being "DELETE" one of the most expensive ones 😀
Most certainly that was an interview question.
I agree regarding the interview stuff. But it was kind of nice to play with it again - just for practice.
I don't think it'll take much more time anyway before MS starts to charge by the number of SQL statements (which is just one step before charging by the keywords used) 😀
Actually, that's a pretty fair concept: If there's a DB with complex code it'll be expensive. If it's just a small system it'll cost less.
And if there are programmers not knowing what to do (e.g. heavy use of any kind of loops) they'd be charged for as well. I might like it 😛
October 20, 2010 at 2:11 pm
LutzM (10/20/2010)
PaulB-TheOneAndOnly (10/19/2010)
LutzM (10/16/2010)
Before going any further I'd like to know the true reason why you don't use the simple DELETE statement.Well... imagine we are in the year 2030 and Microsoft is licensing by the statement being "DELETE" one of the most expensive ones 😀
Most certainly that was an interview question.
I agree regarding the interview stuff. But it was kind of nice to play with it again - just for practice.
I don't think it'll take much more time anyway before MS starts to charge by the number of SQL statements (which is just one step before charging by the keywords used) 😀
Actually, that's a pretty fair concept: If there's a DB with complex code it'll be expensive. If it's just a small system it'll cost less.
And if there are programmers not knowing what to do (e.g. heavy use of any kind of loops) they'd be charged for as well. I might like it 😛
Don't put these ideas in their heads! 😀
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.October 20, 2010 at 3:01 pm
Don't worry, if there's an angle to exploit MS will be there on top of the game 😉
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
October 21, 2010 at 8:49 am
I came up with the same solution as Lutz and I express the same reservations that Lutz and Gail pointed out.
A variant of this would be to copy the data into another table conditionally, truncation of the original table, and reinsertion. And as stated previously would be complicated with keys et al
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply