Pages

Tuesday 27 November 2012

#BADSQL 2

This is my 2nd submission for bad SQL..

Bad SQL 2:
The dev system has run out of disk space.  Lets shrink all the databases, that will free up some space.

EXEC sp_MSForEachDB 'DBCC SHRINKDATABASE (''?'' , 0)'

It might seam like a good idea, but it does apply to EVERY database.
DBCC SHRINKDATABASE ('master' , 0)
DBCC SHRINKDATABASE ('tempdb' , 0)
DBCC SHRINKDATABASE ('model' , 0)
DBCC SHRINKDATABASE ('msdb' , 0)
DBCC SHRINKDATABASE ('ReportServer' , 0)
DBCC SHRINKDATABASE ('ReportServerTempDB' , 0)

Monday 26 November 2012

SQL Event Calendar

 

The SQL event calendar for next year is filing up!!

Tell your friends/colleagues and your pets!

 

SQL Santa London (#sqlfaq) 14th December - http://sqlserverfaq.com/events/452/SQL-Santa-2012.aspx

SQL Saturday Exeter (#sqlsat194) 8th-9th March – http://www.sqlsaturday.com/194/eventhome.aspx

SQLBits XI Nottingham (#sqbits) 2nd–4th May - http://sqlbits.com/

SQL Saturday Scotland  Edinburgh (#sqlsatscotland)  7th-8th June - https://twitter.com/SQLScotland

SQL Relay – (#sqlrelay) Dates coming up…. 

SQL Server User Groups (UK Wide) Various dates (#sqlfaq) - http://sqlserverfaq.com

SQL Saturdays (World) Various dates (#sqlpass) http://sqlsaturday.com

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

Wednesday 21 November 2012

SQLBits XI and SQL Saturday Exeter (194)

It never rains but it pours, not one but two SQL conferences for us to get our teeth into.

SQLBits is back and in the Midlands, Nottingham to be precise – the home of Robin hood… 2nd-4th May.  www.sqlbits.com

And SQL Saturday Exeter (192) is taking place on the 9th of March at Jurys Inn Hotel Exeter, Western Way, Exeter http://www.sqlsaturday.com/194/eventhome.aspx

I’ll be there! Hopefully you can be too!