SQLRally Nordic 2012

IMG_2138SQLRally Nordic is one of the biggest SQL Server related events in Europe. Organised by a couple of very capable volunteers Raoul Illyes and Johan Ahlen this event is the biggest event that PASS is organising in Europe. Labeled as a European Nordic event, it seems that the tradition is to organise it in Sweden and Denmark, changing the location on different years.

IMG_2135This year the event was organised in Copenhagen, Denmark and I was extremely glad when one of my sessions was accepted. I was deeply honoured to be selected to present there.

I was quite surprised by the interest that apparently my session has created – because all the available places were taken and people were standing near the walls and some even sitting on the floor. My session on “Dynamic SSIS Packages generation” as a matter of fact was picked a number of times in 2012, but the most unforgettable of all the presentation for me was at the SQL Rally Nordic in 2012.

Once again I have meet so many good old friends like Hugo Kornelis, Neil Hambly, between others and also manages to get to know a good number of very interesting people from the #sqlFamily, like the organisers themselves – Johan and Raoul, and others like Leonard Lobel, Steve Simon.

I have managed to attend a good number of sessions – I definitely could not have missed some of the sessions by the likes of Connor Cunningham or Thomas Kejser.

All the event organisation for the speakers was absolutely top notch – starting from the speaker dinner and the small excursion on the bus through Copenhagen, and inclusive the amazing speaker gift and all in all relationship to the organisation team.
I am definitely writing this event as the very best event I have ever been to. The location, the number of attendance were exactly right ~450 is when it feels big but at the same time not too big, when you still able to find quickly any person you are looking for, when each and every thing looks well organised and right on time – then this is the SQLRally Nordic. :)

SQLSaturday #170, Munich Germany

SQLSat MunichI was amazingly happy and incredibly nervous when I have received a confirmation of being selected as a presenter for the first SQLSaturday in Germany. Happy – because of being selected and going back to Munich after so many years, and nervous because I knew that I would want to present in German and that the lack of practice that I have had in the recent years has definitely affected my capability of speaking this language. The other dangerous thought that was constantly crossing my mind was that I have never ever made any presentation in German.

46475_471779302853138_1588325839_nI have had a very positive advantage for my presentation – this topic was already presented in Portuguese a couple of month before, so I have received some very good feedback and tips from my local countrymen and delivering it for the second time is always at least 3 times easier then doing it for the first time.
So, I told to myself that there is nothing else to be afraid of as I have decided to jump in and deliver my “Dynamic SSIS Packages” session in German, even though I have not even checked how to say the respective SSIS terms in German.

IMG_2101PASS Deutschland Team (which consisted of Oliver, Tillmann, Constantin, Dirk and others) have made a wonderful choice of selecting Munich for the first SQLSaturday in their country. I personally think that the location was nearly perfect – it was close to the airport but also close to Munich as well. The German Microsoft HQ are really nice place to have an event, and so far I know it was the very same impression from the most of the attendees.

This event was exactly one week after the SQLSaturday in Cambridge, UK – and so I have managed to find a good number of people that I have been with 7 days before. Since Karla Landrum & Rodney Landrum were travelling in Europe, they have attended both of the events, which was a great deal of fun for me – I have managed to spend a good amount of time talking to Karla about some ideas and plans for the future of the SQL Server community in Europe. I was extremely happy to meet again the likes of Hugo Kornelis, Allan Mitchel, Jen Stirrup, Tobiasz Koprowski, between others.

In 2012 it was a good number of times (at least 4), that my session was picked up to be as the first one at the events. This situation is very interesting, because you actually don’t get a real feeling of how the event starts, since you are occupied verifying everything once again while people are arriving at the registration. So definitely at this event I have managed to get the feeling of the event only in the second part of it – since I was busy preparing and then delivering the presentation while people were arriving.

IMG_2092My presentation went quite well – I know that there were a couple of awkward moments when I was looking for the right term (though Germans do use english terms like DataFlow or OleDBSource when talking about the SSIS components), but overall I am quite happy with the presentation that I have delivered. :) I have received some very useful critics about my presentation and I hope to have learned together with the attendees a couple of things.

The rest of the event I have spent attending a couple of sessions and talking to a lot of old friends and meeting a lot of new great people like Oliver Engels, Tillmann Eitelberg, Dirk Hondong, Sascha Lorenz and a lot of others. It was one of those events where you definitely looking for more and can’t get enough of it. The day ran very fast and by the time we were leaving I have had a sad feeling that it was already over.

541143_525250557488334_731314809_nIt was not completely over yet, because the organisation team have put together a dinner at the Hotel where most of the speakers were staying, so we have shared a wonderful meal with a lot of conversation right until the moment when we were actually invited to leave, since they were closing the doors of the restaurant.

Oliver, Tillmann, Kostja and their crew have made a wonderful job of organising this event. With a great support from Microsoft Germany (starting from the availability of the wonderful HQ near Munich and including the PMM & MVP Lead both being present there).

On Sunday, before leaving back home, I have managed to get to the center of Munich and spent a couple of hours visiting some very beautiful places around.

I guard some amazingly happy memories from this event and I hope to see more such SQLServer community events in Germany next year (2013).

SQLSaturday #162, Cambridge UK, part 3

Buck WoodyThis was one of more social events for me, as I have managed to speak with a lot of people including the likes of Karla Landrum, Jen Stirrup, Allan Mitchel, and of course Mark Broadbent and Lorraine. It was great to see a number of companies sponsoring this effort, as without their support a lot of such great initiatives shall be quite limited – so I did my best to talk to them all, in order to learn better about their products. If you are enjoying any event, you should really try to say it not only to organisers but to the sponsors as well.

I have managed to attend a couple of sessions, “Windows Azure from a Data Perspective” by Buck Woody which was a really great one and “Troubleshooting SQL Server with PowerShell” by James Boother, where once again I was serving as a session monitor. Both sessions were really enjoyable and for those looking to get an understanding of both technologies (Azure SQL Database & Powershell) they were really not to be missed.

CambridgeThis was one killer event, and every time I think about having courage of running a SQLSaturday, I really think of Mark who showed a great courage of risking loosing his own money in order to make this event happen. I really believe that people who attended it should show a token of great appreciation for all that he has done for the local English SQL Server community.

Once again I think that the effort of the organiser’s partner should be underlined, as Lorraine has sacrificed a lot of her personal time in order to support Mark with this whole idea of giving something good for the local community.

Cambridge_3I have spent at least a half of Sunday visiting some of the amazing sightseeing that Cambridge and Ely offer, and there is no doubt that all the area around the first SQLSaturday in the UK is to be explored in the nearest future, hopefully this time with my family and with more time to explore all the cultural and historical treasures. I would recommend to anyone this event – you will get much more then you would expect – a great SQL Server learning, a lot of new personal connections and friendships and you might even stick for a couple of days because of the amazing environment.

I expect that in the year 2013 this story to be continued…

SQLSaturday #162, Cambridge UK, part 2

Even though I have arrived late to Cambridge and stayed after even later hour drinking a couple of beers with the SQLSaturday organizers I was still capable to wake up very early because I wished to support the event organizers in the morning.

Me and Bruno Basto (another portuguese presenter at SQLSat #162) woke up at 6:20 in order to be able to be at the registrations around 7:15. Bruno was very kind to share his room with me, which had some good and not so very good sides, because every night before falling asleep we have spent a couple of hours talking on all matters around SQL Server and SQL Server community. :)

Arriving at the location of the SQLSaturday #162 in Cambridge I was struck by the location and the quality of the venue – Mark and his team have selected the hotel Crowne Plaza right in the center of Cambridge. I know that It was not an easy choice, because they could not get any other place on the base of the capacity or because of the other limitations, like the requested price. I think that overall the venue has provided the desired quality for the event attendees especially including the specificity of the event itself. Creating the very first SQLSaturday in the UK has a lot of responsibilities like setting the right standard on what can and what should be done, while opening more doors to the members of the SQLServer community in the UK.

At the moment of our arrival the registration was already going strong with all the sponsors being present at their respective tables and the registration table being occupied by Mark himself and his lovely wife Lorraine. PASS Table was occupied by Karla Landrum and Jonathan Allen (UK Regional Mentor) who were fiercely promoting the PASS. Actually on my arrival Karla went to help Mark with the registration process so I was given an opportunity to stay and represent PASS at their table.

It is quite interesting to find out that the most people coming to SQLSaturdays have no idea about the PASS or that each and every SQLSaturday is actually being organized in partnership with PASS. One might object against the whole idea of the SQLSaturday being supported by PASS because this support might be almost invisible, but actually one should not forget about some of the details like potential Sponsorship as well as an established brand itself, which in my personal opinion are some very important steps for the event success.

I have not spend whole lotta time at the PASS table because I was assigned as a “monitor” for one of the first sessions. Monitoring session at the SQLSaturday basically means to attend it but to watch out for the time, advising the speaker when time is getting close to an end, like 15 min before the final and then at 10 min and 5 min respectfully. Also it means to watch out for all the room not to get overcrowded and to support the speaker with whatever he/she might be needing.

The first session of the day that I was monitoring was the one on the Partitioning by David Peter Hansen. I really enjoyed it a lot – it was an introductional level session explaining some of the basics of partitioning practices. I also felt that the most of the attendees really enjoyed it, because there was quite a healthy level of interaction between the presenter and the attendees.

After that I have spent the rest of the time preparing and rehearsing once again my session which was the third one on the schedule. One of the most exciting things that has happened to me in that time was a very interesting conversation with Buck Woody at the speaker room. I have always had quite a high opinion of him, but after that conversation I can definitely assure you that it has jumped up 2 times at least. I always love talking to people from whom I might be able learn a thing or a two, and Buck is definitely one of those guys from whom I am looking to get more in the nearest future.

As everybody knows, the time passes really fast when you have a lot of things to do, and so around 10AM at the scheduled time I started delivering my session on the best practices for the developers to do when inheriting a database developed by others. I have had a small but rather nice number of people in the room where I was presenting which were not falling asleep but interacting quite actively. I was glad to receive a couple of questions by the email from the attendees which means that the session did not left the people indifferent.

to be continued…

The very first BItuga event with Donald Farmer

It is official – after a couple of months of work we have finally launched the site for the newest PASS Chapter BItuga, which stands for the Portuguese Business Intelligence community. I am extremely proud of this effort, since it was worked on for so many times without any announcement or request for help.

To celebrate the launch of this new Business Intelligence community we have managed to invite a very noted speaker – Donald Farmer, who works for QlikTech. Donald is a very well-known and respected BI specialist, having spent a big number of years working for Microsoft as a PM and has been baptized by a good number of people I know as a “Father of Microsoft BI”.

The opening free event is planned for the 16th of October of 2013 in the morning, mainly because of the Donald availability – indeed he as very busy man traveling the world. The agenda is already defined and Donald will be delivering 2 presentations with one being focused on the general BI perspective and the second one being more connected with QlikView tools.

Paulo Matos who is leading this effort will be definitely bringing some very new perspective and vision to the portuguese community map. In my personal opinion it is a needed community and Paulo being a very experienced IT Pro and organizer (remember his notable effort helping organizing of the SQLSaturday #115 Seminar and the SQLSaturday themselves.

I will be continuing supporting BItuga in the role of a ‘board-member’, providing some accesses and connections for the event organizations.

If you are living or will be staying in Portugal on the 16th of October of 2013, then don’t waste any second and sign up for the free BI event with Donald Farmer now.

Stay tuned cause we are really about to rock the BI quite massively in 2013. ;)

SQLSaturday #162, Cambridge UK, part 1

Cambridge, my Cambridge oh SQLSaturtday

It was almost a regular friday morning at the office, on the 7th of September of 2013.
I called it almost a regular because there were some little differences like starting the working day very early around 8AM, and working not until the late evening because I had a very important task todo – to catch a plane to London UK and then to get to the SQLSaturday #162 in Cambridge.

As any reasonable human would expect I thought that most complicated part of my day would be to catch a plane and to do the trip between London and Cambridge. I was wrong, so wrong since my day started with a good amount of tasks at the Production environment with a whole lot of people requesting my help. It was exactly one of those days when things go wrong for a number of projects for a number of reasons but at the same time.

So from a typical less stressful friday this day has very rapidly become a nightmare, which lasted right until the moment when I had to finally leave to catch the plane and let me tell you that it was not an easy task because having a director of IT on your back screaming at the people around you is not a pleasant thing and even though he is not mad with you directly, you don’t want to wave with a flag to be fired at. :) I honestly started to think if I would be able to catch the plane at all, because no sane DBA would leave his/her company in a situation when some of the important tasks on the business side cannot be done.

It has got a little bit worse before it got better, because as I was already switching my PC off and I have already cleaned out my desk, I have got one of the Project Managers running to me and waving with his hands screaming that he needs my help and saying that he has got a critical problem in a production environment that was needed to be solved ASAP. I had to use my jedi powers to keep calm while thinking hat I would be loosing a plane while solving his situation. My actual jedi powers were not need since he was actually joking so my breathing slowed down and I was able to see the light again and I was free to catch a cab until the Lisbon Airport.

Traveling in Europe is typically a very simple task, since the procedures are quite standard and there are no complications with visas and so on. The only thing which can go unexpected is the flight delay or eventual cancelation, these are the things which scary the people out. Our plane was delayed for a good 30 minutes, but because we have had no critical hurry – we could just sit back and relax.

Being a speaker at SQLSaturday in Cambridge has some very very serious privileges, like being picked up at the airport in a luxury car and being brought right to the door of the hotel, and just to have it my mind that we are talking about the distance between Cambridge and London which is around 80 miles !!!

After a very nice and comfortable ride which took around 90 minutes we were ready to take on the Cambridge folks, but since we have managed to leave the airport around 7:30, it was only somewhere after 9PM that we have finally managed to leave our baggage at the hotel and start looking for the venue of the Speaker Dinner, which was just another XXX given by Mark Broadbent and his team. Knowing that the dinner was to take place at 7pm we actually had quite low hopes of getting some food at the “Strada” italian restaurant that was chosen for the speaker dinner purpose.

We were very pleasantly surprised by the fact that the organizer team and the invited speakers were still finishing their desert, so we have got a special treatment of being able to get some very nice italian dishes and to join the rest of the crowd (~40 people).

While waiting for the food being prepared I have had a wonderful opportunity to meet and great so many great friends like Mark Broadbent, Karla Landrum, Rodney Landrum, Allan Mitchel, Jen Stirrup, Hugo Kornelis, Neil Hambly, Rob Volk, and so many others!
The environment was not just fantastic, no … It was inspiring.

Me & Bruno Basto (the other portuguese speaker) have spent quite some time in the night chatting with other speakers and organizers, exchanging opinions and simply trying to adapt to a different environment of a different country. I love those speaker events because they really serve as an adaptation period for the speakers coming from different countries and places. It gives the opportunity to establish the first contacts which shall be eventually continued during the event and even after it.

So after spending a couple of hours at the restaurant and at a pub where we went with some other speakers.
I felt that I was ready to face the crowd of the SQlSaturday #162.

To be continued…

Char(1-2) vs Varchar(1-2) to be NULL or to be NOT NULL

Continuing the small research that I have been doing on the matter of the Varchar(1) & Varchar(2) datatypes usage, I am taking this article to consider the situations when the columns are defined as NOT NULL.

Following the same scheme as with the first post of this series, here is the code for creating 2 similar tables with CHAR and VARCHAR datatypes, which are different to the first post that those 3 columns are not null:

CREATE TABLE dbo.CharTestTableNN
(
	id INT IDENTITY NOT NULL PRIMARY KEY,
	client_name CHAR(20) NOT NULL DEFAULT 'SuperClient',
	sex CHAR(1) NOT NULL DEFAULT 'M',
	confirmation CHAR(1) NOT NULL DEFAULT 'N',
	state_code CHAR(2) NOT NULL DEFAULT 'WA',
	some_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	some_amount DECIMAL(9,2) NOT NULL DEFAULT 128.34,
);

CREATE TABLE dbo.VarcharTestTableNN
(
	id INT IDENTITY NOT NULL PRIMARY KEY,
	client_name CHAR(20) NOT NULL DEFAULT 'SuperClient',
	sex VARCHAR(1) NOT NULL DEFAULT 'M',
	confirmation VARCHAR(1) NOT NULL DEFAULT 'N',
	state_code VARCHAR(2) NOT NULL DEFAULT 'WA',
	some_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	some_amount DECIMAL(9,2) NOT NULL DEFAULT 128.34,
);

-- Insert 1.000.000 rows into both tables
SET NOCOUNT ON;
BEGIN TRAN
	DECLARE @i INT;
	SET @i = 0;

	WHILE @i < 1000000
	BEGIN 
		INSERT INTO dbo.CharTestTableNN
			DEFAULT VALUES;

		INSERT INTO dbo.VarcharTestTableNN
			DEFAULT VALUES;
			
		SET @i = @i + 1;
	END
COMMIT;

-- Lets compare the space occupied 
EXEC sp_spaceused 'dbo.CharTestTableNN';
EXEC sp_spaceused 'dbo.VarcharTestTableNN';

-- Drop Those Tables
DROP TABLE dbo.CharTestTableNN;
DROP TABLE dbo.VarcharTestTableNN;

The results speak for themselves: the difference is very noticeable, as in the case of the CHAR columns we have ~50MB occupied and which is exactly the same as when using NULLable columns. From the other side, our table VarcharTestTableNN which is using Varchar datatype for the columns jumped from ~46MB to almost 58MB, thanks to all the additional space occupied by the Varchar Datatype.

-- Consult the row length of the tables
select OBJECT_NAME(object_id) as TableName, min_record_size_in_bytes, max_record_size_in_bytes, alloc_unit_type_desc, index_level, record_count, page_count, avg_page_space_used_in_percent
	from sys.dm_db_index_physical_stats (db_id(), object_id('dbo.CharTestTableNN'), null, null, 'detailed');

select OBJECT_NAME(object_id) as TableName, min_record_size_in_bytes, max_record_size_in_bytes, alloc_unit_type_desc, index_level, record_count, page_count, avg_page_space_used_in_percent
	from sys.dm_db_index_physical_stats (db_id(), object_id('dbo.VarcharTestTableNN'), null, null, 'detailed');

Checking out the internal row length we can see that in this case that while the table with CHAR datatypes continues occupying 48 bytes per row, the table with Varchar datatype columns has jumped to quite fat 56 bytes per row. This naturally confirms that when you know the exact length, you should use the exact datatypes instead of the varying.

So, it looks quite logical to me, that when you have all the textual content filled out – CHAR datatype is definitely in occupying less space, but what about situations when our columns are defined as NOT NULL but they are actually empty or half empty? Lets check it out :

-- Lets create 2 additional tables, one with non null columns but with no content, and other with only half of the columns full
CREATE TABLE dbo.VarcharTestTableNN_Empty
(
	id INT IDENTITY NOT NULL PRIMARY KEY,
	client_name CHAR(20) NOT NULL DEFAULT 'SuperClient',
	sex VARCHAR(1) NOT NULL DEFAULT '',
	confirmation VARCHAR(1) NOT NULL DEFAULT '',
	state_code VARCHAR(2) NOT NULL DEFAULT '',
	some_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	some_amount DECIMAL(9,2) NOT NULL DEFAULT 128.34,
);

CREATE TABLE dbo.VarcharTestTableNN_Avg
(
	id INT IDENTITY NOT NULL PRIMARY KEY,
	client_name CHAR(20) NOT NULL DEFAULT 'SuperClient',
	sex VARCHAR(1) NOT NULL DEFAULT 'M',
	confirmation VARCHAR(1) NOT NULL DEFAULT 'N',
	state_code VARCHAR(2) NOT NULL DEFAULT '',
	some_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	some_amount DECIMAL(9,2) NOT NULL DEFAULT 128.34,
);



-- Insert 1.000.000 rows into both tables
SET NOCOUNT ON;
BEGIN TRAN
	DECLARE @i INT;
	SET @i = 0;

	WHILE @i < 1000000
	BEGIN 
		INSERT INTO dbo.VarcharTestTableNN_Empty
			DEFAULT VALUES;
			
		INSERT INTO dbo.VarcharTestTableNN_Avg
			DEFAULT VALUES;

		SET @i = @i + 1;
	END
COMMIT;

-- Lets compare the space occupied 
EXEC sp_spaceused 'dbo.VarcharTestTableNN_Empty';
EXEC sp_spaceused 'dbo.VarcharTestTableNN_Avg';

The results are quite logical - the empty space filled, NON NULL table VarcharTestTableNN_Empty occupies a 45.7 MB which is a bit more then a NULL table in the previous article (45.6MB). At the same time, the table with just half of the content columns filled (VarcharTestTableNN_Avg) occupies an intermediate amount of space - 53.9MB, which is exactly between the 46MB of the NULL and 58MB of the full ones.

Lets see what has changed in the terms of the row length for this tables:

-- Consult the row length of the tables
select OBJECT_NAME(object_id) as TableName, min_record_size_in_bytes, max_record_size_in_bytes, alloc_unit_type_desc, index_level, record_count, page_count, avg_page_space_used_in_percent
	from sys.dm_db_index_physical_stats (db_id(), object_id('dbo.VarcharTestTableNN_Empty'), null, null, 'detailed');

select OBJECT_NAME(object_id) as TableName, min_record_size_in_bytes, max_record_size_in_bytes, alloc_unit_type_desc, index_level, record_count, page_count, avg_page_space_used_in_percent
	from sys.dm_db_index_physical_stats (db_id(), object_id('dbo.VarcharTestTableNN_Avg'), null, null, 'detailed');

The row length speaks for itself, here with 44 bytes for NON NULL Empty table and with an intermediate result of 52 bytes for the table with only half content columns filled (VarcharTestTableNN_Avg).

These results need just one last comparison - the missing link of the Char datatype column with empty content, so lets check it out:

CREATE TABLE dbo.CharTestTableNN_Empty
(
	id INT IDENTITY NOT NULL PRIMARY KEY,
	client_name CHAR(20) NOT NULL DEFAULT 'SuperClient',
	sex CHAR(1) NOT NULL DEFAULT '',
	confirmation CHAR(1) NOT NULL DEFAULT '',
	state_code CHAR(2) NOT NULL DEFAULT '',
	some_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	some_amount DECIMAL(9,2) NOT NULL DEFAULT 128.34,
);

-- Insert 1.000.000 rows 
SET NOCOUNT ON;
BEGIN TRAN
	DECLARE @i INT;
	SET @i = 0;

	WHILE @i < 1000000
	BEGIN 
		INSERT INTO dbo.CharTestTableNN_Empty
			DEFAULT VALUES;
			
		SET @i = @i + 1;
	END
COMMIT;

-- Checking on the row length
select OBJECT_NAME(object_id) as TableName, min_record_size_in_bytes, max_record_size_in_bytes, alloc_unit_type_desc, index_level, record_count, page_count, avg_page_space_used_in_percent
	from sys.dm_db_index_physical_stats (db_id(), object_id('dbo.CharTestTableNN_Empty'), null, null, 'detailed');

-- Checking out the space occupied
EXEC sp_spaceused 'dbo.CharTestTableNN_Empty';

The results are presented here on the screenshots with row length being 48 bytes and occupied space being around 50 MB. The Char datatype are consistent through different types of situations and seems to be quite predictable.

Basic results:

Lets compare all the results we have tested so far (I am already including the math of removing from the reserved space the pre-allocated unused space):

Name Description Row Length (Bytes) Size (KB)
CharTestTable Char NULL 48 48888
CharTestTableNN Char NO NULL full 48 48888
CharTestTableNN_Empty Char NO NULL empty 48 48888
VarcharTestTable Varchar NULL 44 45632
VarcharTestTableNN Varchar NO NULL full 56 57884
VarcharTestTableNN_Empty Varchar NO NULL empty 44 45632
VarcharTestTableNN_Avg VarChar NO NULL hallf full 52 53904

There are a couple of things visible to me from this table - first of all is that with CHAR you get the what you request in the terms of the space, independently from the final result you get some constant values. The tables with Varchar(1) or Varchar(2) are the same consistent story of the variable length columns - it can be smaller and it can be bigger, depending on the content and the rules.

The interesting thing is so far being confirmed that even those small datatypes perfectly having their own space in the database design. Also, if your table has a lot of NULL or empty spaces then go for Varchar datatype, it can improve occupied space by the table.

To be continued