Pages

Monday 26 November 2012

Bad SQL, Naughty SQL!

 

During my time as a dev, I’ve done some bad things in SQL, some terrible things that still give me nightmares. 

But I feel like a bit of therapy and I should share, and perhaps you would like to share too?

Bad SQL 1:

I think I used it on a dev system that ran out of space.

   1:  EXECUTE sp_MSforeachtable "ALTER TABLE ? REBUILD WITH (DATA_COMPRESSION = page)";  

 

Feel free to share your BAD SQL, please post anonymously if you are too ashamed. Smile

No comments:

Post a Comment