Pages

Thursday, 28 July 2011

Drawing a circle in SQL Server (almost)

I've just started playing with the Geo spatial data types in SQL Server 2008 R2 Express.
The first thing I wanted to do was draw a circle.  How difficult could it be?

I could not find an example on the interweb - so I put one together.

   1:  DECLARE @Points AS FLOAT = 360;
   2:   
   3:  DECLARE @count AS INT = 0;
   4:   
   5:  DECLARE @size AS INT = 1;
   6:   
   7:  DECLARE @tmpTable TABLE (
   8:      geo geometry);
   9:   
  10:  WHILE (@count < @Points)
  11:      BEGIN
  12:          INSERT INTO @tmpTable
  13:          SELECT geometry::STGeomFromText('POINT(' + CAST (SIN(RADIANS((CAST (@count AS FLOAT) / CAST (@Points AS FLOAT)) * @Points)) * @size AS VARCHAR) + ' ' + CAST (COS(RADIANS((CAST (@count AS FLOAT) / CAST (@Points AS FLOAT)) * @Points)) * @size AS VARCHAR) + ')', 4326) AS Posn;
  14:          SET @count = @count + 1;
  15:      END
  16:   
  17:  SELECT geo
  18:  FROM   @tmpTable;  

Now choose the 'Spatial Results' tab - you might have never seen this before. It only appears if the results set has a geospatial data type in it.




The observant of you might notice, it's not actually a circle. Just 360 different point (there is a different!) But I'll cover that in my next blog post.

[UPDATED: Added link to scripts]
All scripts can be found on my SkyDrive using the link below.

Monday, 18 July 2011

Southampton SQL User Group Next Events

[Updated: For latest news and events at Southampton SQL User Group follow this link]

I've been busy organising the next events for the Southampton SQL User Group and here they are.

10th August, John Q Martin and Neil HamblyDetails
7th September, Jessica Meats and Simon Sabin (MCM/MVP)Details
5th October, Justin Langford (MVP) and TBCDetails
One year Anniversary 
9th November, Allan Mitchell  and James Rowland-Jones

Details

For details of your local SQL Server User Group visit http://www.sqlserverfaq.com

Sunday, 17 July 2011

SQLBits 9 - Session submission

 

I’ve finally done it, I’ve submitted a session for SQLBits 9!!

 

God news knows if it will be picked, but it will only get picked if people vote for it!!!

 

So get on and vote!! If not for me, then someone else! http://sqlbits.com/information/publicsessions.aspx

Saturday, 16 April 2011

SQL Server User Groups in the UK!!

I tried to get this list together before SQLBits 8, but failed.  It contains SQL Server User Groups and the postal code of where it was held.  I've included SQLBits (for fun!).  Its not every single one thats ever happened, buts ones that have happened over the last 7 or 8 months. I apologise if I've missed you off!!



UG Name,City,Postcode
---------------------
Scottish Area User Group,Edinburgh,EH1 3EG
SQL Herts,Hatfield,AL9 5HZ
Leeds User Group,Leeds, LS3 1EP
Manchester User Group, Manchester, M1 3HU
SQLSoton,Southampton,SO17 1XQ
Cardiff User Group,Cardiff,CF10 5BT
Bristol User Group, Bristol,BS1 4QD
Kent SQL Server and .NET User Group,Maidstone,ME14 1ED
Birmingham User Group,Birmingham,B2 5NY
Surrey User Group,Camberley,GU16 7ER
Bracknell User Group,Bracknell, RG12 1AQ
Dundee User Group,Dundee, DD1 4HN
Reading UG,Reading, RG6 1WG
London UG,London, EC4M 7AN
Cambridge UG,Cambridge,CB4 0WZ
BCS,Telford, TF2 9FT
SQL SouthWest,Exetor,EX1 1JJ
SQLBits 8,Brighton, BN1 2FW
SQLBits 7,York,YO10 5DD
SQLBits 6,London,SW1P 3NZ
SQLBits 5,Newport,NP18 1HQ
SQLBits 4,Manchester,M15 6BH
SQLBits 3,Hatfield,AL10 9AB
SQLBits 2,Birmingham,B4 7ET
SQLBits 1,Reading, RG6 1WG


Link to these points on a bing map

*SQL SouthWest postcode is a guess.

Thursday, 14 April 2011

The SQLBits 8 Community Corner Map!

After 2 days of pinning, this is the result....The SQLBits 8 Community Corner Map!

I would like to thank all the people that came to Community Corner and stuck pins in the map and all the very kind non-UK people that took the time to draw their own countries (including Italy, Germany, Holland, Sweden, Norway, Denmark, Austria and Australia ) and pin them on the map.

Here is all your work.......




I have to thank all the people who stayed in Community Corner and represented the SQL Communities in the UK! - You know who you are!!! Finally we have to thank the SQLBits committee who gave us the opportunity to have community corner.

See you at the next SQLBits!!

Red pins = User Groups , Blue Pins = People..

Friday, 4 March 2011

T-SQL Tidy SSMS 2008 R2 released...

Tonight I've finally done it, posted up the R2 version of the SQL Server Management Studio Add-in.

You can download it from here; http://www.tsqltidy.com/downloads/addinR2.zip

It's got some new features!!!
  • Local formatting (no longer uses the web service - so no internet connection required)
  • Lots and lots of formatting options.
  • Format SQL to HTML!
So on give it a go, what have you got to lose?

Thursday, 17 February 2011

Comments now supported on web site and in SSMS add-in!

After a very very long long long long time, I've finally got support for single and multi-line comments.

Many many thanks to Matt (@atlantis_uk ) at http://www.atlantis-interactive.co.uk/ without who the site would be comment less.

So enjoy! Its not 100% perfect, there are some HTML formatting issues, but I felt I needed to get this release out there.

If you are using the SQL Server Management Studio Add-in, comments are now automatically supported.

So enjoy well formatted SQL and HTML!!

Friday, 4 February 2011

SWAG from Redgate arrived!

The SWAG for the SQLSoton (SQL Southampton) User Group has arrived, Woo Hoo!

Red-Gate has sent;
USB Keys preloaded with some Ebooks.
Red-Gate stickers.
Pens
Lanyards
and what I think are luggage ID tags (made from real cow).



A huge thanks to the peeps at Red-Gate for sending over this SWAG - there will be many happy faces at the next UG.

So if you want your share, come to the User Group on the 9th Feb... details here.

Tuesday, 25 January 2011

SQLSoton (SQL Southampton) User Group dates..

Here are the User Group dates for the next few months:
  • Feb 9th
  • March 9th
  • April 13th
  • May 11th
  • June 8th
Go to SQLServerFAQ.com to register.

See you there!!

Monday, 24 January 2011

Your User Group needs you.[Big pointy finger]

The SQL Server User Group in Southampton (@SQLSoton ) needs you!!

If you are an experienced speaker or just want to try presenting for the first time then get in contact with us! We are looking for presentation between 15 and 60 minutes.

Dont just sit there and think about it, send us an email and you could be presenting next month!


Thursday, 20 January 2011

Cultural Learnings of User Group (dis)Organiser for Make Benefit Glorious Nation of SQL Server

WOW!!!

I think that about sums it up; WOW!!!

Before I get all gushy, I just want a quick Oscar moment - I would firstly like to thank every person that came, without your support there would be no User Group.

Secondly, I’d like to thank @AdaTheDev (Adrian) and @atlantis_uk (Matt) for organising and sorting out the Feng shui.

And of course @ChristianBolton, for being our crowd pulling speaker. I’m sure the turnout would not have been so high without him.

Come to User Group, It's Nice!

Be careful what you wish for as it just might happen. I was expecting a few more people to turn up this time, but based on previous experience I was expecting 9 or 10. I was not expecting to more than double the turnout; 15! Every chair in the room (which was bigger than last time) was taken…

So my learnings are – You have no idea how many people will turn up until 7.10pm.

 

I ordered the food based on the number of people I was expecting. Since all the food was gone, even the biscuits,… I don’t think there was enough! I’ve been tweeting @GavinPayneUK about the pizza to persons ratio.

So my learnings are – order more!

We were trying out a new room, so Matt, Adrian and I spent a while working out the best room configuration before the geeks the punters arrived, which worked well. Once Christian had finished his talk and I’d got back with my inadequate supply of pizza, people eat, chatted.  But as Matt pointed out we should have put the chairs away to free up space in the room.

So my learnings are – work out the best use of space in advance.

 

For the first UG, I created some feedback forms which never got used as there were so few of us. Okay, I’ll put my hands up and say I didn’t create the feedback form; @ctesta_oneill did. I just changed the name of the UG at the top! But I did click print… (Don’t think I even convinced myself). We really could have done with them. Even if it was just a way of keeping track of who turned up.

So my learnings are – Don’t throw away feedback forms.

 

Now I’m eagerly checking twitterverse and blogosphere to see what people thought….  If you were there, you too can improve the cultural learnings of User Group (dis)organiser for make benefit glorious nation of SQL Server [Please tweet or blog your thoughts…  I promise not to get offended!!]

See you all in Feb!!!

Thursday, 9 December 2010

Confessions of the User Group (dis)Organiser

Yesterday was the first Southampton SQL Server User Group and I just wanted to share some of my thoughts on how to arrange a successful one...

1) DON'T RUSH - Whatever you do, don't sit at work one day and think; I know, I'll start a UG, then pick the phone up and book a venue. Take your time, have a couple of months lead-up. This gives you time to organise and think of EVERYTHING.

2) DON'T LOOK AT A PICTURE OF THE VENUE AND THINK; THAT ROOM LOOKS OKAY - Visit the room. The size and shape of a small room can dictate the kind of UG that you can have. Is there going to be enough room to get a decent projection onto a wall or white-board? Can you move the chairs around and not affect the function of the room (blocking-off an area of the room)?

3) DON'T PUT DIRECTIONS TO VENUE UP THE DAY BEFORE THE EVENT - Put up directions or special instructions on the internet well in advance.

4) BRING A 4-WAY - Who knows where the power points are? There is a good chance there will not be power where you need power.

5) BELIEVE IN MURPHYS' LAW - If you can bring spare kit, just in case something goes wrong, then do it. What's the worst that can happen? You don't use it.

6) ORGANISE THE FOOD IN ADVANCE - As Murphy's Law states; what can go wrong will go wrong... Including my phone stopping working and managing to block my debit card when ordering food in a rush.

7) DON'T EXPECT PEOPLE THAT SAID THEY WOULD DEFINITELY TURN UP TO TURN UP - Random stuff happens; people say they can come, but life gets in the way. Always expect less people to turn up. Perhaps even 1/3 to 1/2 less.

And even if you don't manage to follow all these steps, it is still possible to have a really successful UG!

For the next UG, I have promised myself that I won't make the same mistakes again. I'll make a whole load of new ones!