databasejournal.com databasejournal.com

SQL Sam and the Never-Ending Delete - Part 1 - Page 2

SQL Sam and the Never-Ending Delete - Part 2 Environment: SQL Server 6.5, SP5a Turn ON clues "Hmmm," said Sam. There's only one process in your accounts database, and it's not blocked. But there is something interesting here- the command shows up as "INSERT", not "DELETE". "Could be a bug in sp_who2," suggested Nully. "Maybe," said Sam, "but I doubt it. I think there's more going on here than meets the eye. Is it okay if we stop...

databasejournal.com databasejournal.com

The Bit Corner, Inc.

What's in a name? When I was attending Arizona State University, I had my first class in microprocessor programming. The teacher would challenge us by having us write a program that did something in the least number of instructions. He would tell us his solution "did it in 23 instructions"; extra credit was given to those who could beat it. For a select few of us, this wasn't just another college course to survive. This was our first...

databasejournal.com databasejournal.com

SQL Sam and the Phantom Connection - Part 1 (with clues) - Page 3

SQL Sam and the Phantom Connection - Solution! "What do you mean, Sam?" Jimmy asked. "I don't see any connections..." "Don't forget, Jimmy, that when you run a scheduled task, the SQL Executive Service makes a connection into SQL Server. And it has to establish a connection to a particular database." "How does it decide what database to connect to?" asked Jimmy. "Keep looking," smiled Sam. "You'll see it..." "Oh!" Jimmy...

databasejournal.com databasejournal.com

SQL Sam and the Never-Ending Delete - Part 1 - Page 3

SQL Sam and the Never-Ending Delete - Solution! "It's not alien abduction, psycho-kinesis, or some other unexplained phenomona?" said Nullder, sounding disappointed. "No, it's really much simpler than that," said Sam. "First, you said you were deleting about a million rows from a five-million row table. You're doing it with one DELETE, which makes it an implicit transaction that must succeed in its entirety. So, SQL Server has to log...