LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

You don't need to shrink a database to get a smaller backup

Last weekend I decided to do some maintenance on one of our database to see if I can get some freespace back. I use compression for some of the older tables and also reindexed the tables with a higher fill factor. After I was done, I got over 200 GB of additional free space Here is what the database looked like before I did the maintenance FILEID FILE_SIZE_MB SPACE_USED_MB FREE_SPACE_MB 1 179353.81 162922.13 16431.69 2 64.01 14.33 49.68 3 297089.13 265538.44 31550.69 4 344555.69 298126.69 46429.00 5 165258.50 123946.63 41311.88 Here is what the database looked like after I did the maintenance

Read More...

Automating the LessThanDot Deployment

LessThanDot is composed of 3 distinct PHP packages wired together with some home-built screens, a homemade authentication system, and a bit of string and glue. In fact, it is similar to hundreds of thousands of systems out there, that evolve out of bits and pieces integrated in unique and interesting ways. We deploy our site manually using file copy methods, with separate QA and Development environments. Fortunately, being PHP and not compiled, we can limit our deployments to just changed files instead of full deployments. Unfortunately the closest (Dev and Prod) have over 80 file differences, and our code repository has over 1000 (yes, one thousand) from production. We’ve accidentally deployed older versions of files from our code repository. We’ve even deployed the QA or a local Dev configuration file to production, which doesn’t work so well.

Read More...

Report Builder 3.0 – Map Wizard

This is part five of a series about Report Builder 3.0. Report Builder 3.0 – The Introduction Report Builder 3.0 – Table or Matrix Wizard Report Builder 3.0 – Chart Wizard Report Builder 3.0 – Chart Types, Visualizations, and Properties Report Builder 3.0 – Report Parts When SQL Server 2008 was introduced, it included the new spatial data types of geometry and geography. Report Builder 3.0 gave us the capability to add maps to reports, which can utilize those data types to visualize data.

Read More...

Another decompiler: ILSpy.

This one is open source (didn’t really check if the others were) and also free. And the little one is called [ILSpy][1]. Like with the [previous post about justdecompile and dotpeek][2] I also decompiled the following code. Module Module1 Sub Main() Dim array1() As Integer Dim array2(-1) As Integer Dim array3(0) As Integer Dim array4(1) As Integer Dim array5() As Integer = {} Dim array6() = New Integer() {} ReDim array1(-1) Console.WriteLine(array1.Count) Console.WriteLine(array2.Count) Console.WriteLine(array3.Count) Console.WriteLine(array4.Count) Console.WriteLine(array5.Count) Console.WriteLine(array6.Count) Console.ReadLine() End Sub End Module``` And these are the results. For C3. <div class="image_block"> <a href="https://lessthandot.z19.web.core.windows.net/wp-content/uploads/users/chrissie1/decompilers/ILSpy1.png?mtime=1332876766"><img alt="" src="https://lessthandot.z19.web.core.windows.net/wp-content/uploads/users/chrissie1/decompilers/ILSpy1.png?mtime=1332876766" width="963" height="682" /></a> </div> For IL. <div class="image_block"> <a href="https://lessthandot.z19.web.core.windows.net/wp-content/uploads/users/chrissie1/decompilers/ILSpy2.png?mtime=1332876779"><img alt="" src="https://lessthandot.z19.web.core.windows.net/wp-content/uploads/users/chrissie1/decompilers/ILSpy2.png?mtime=1332876779" width="963" height="682" /></a> </div> Fro VB.Net. <div class="image_block"> <a href="https://lessthandot.z19.web.core.windows.net/wp-content/uploads/users/chrissie1/decompilers/ILSpy3.png?mtime=1332876792"><img alt="" src="https://lessthandot.z19.web.core.windows.net/wp-content/uploads/users/chrissie1/decompilers/ILSpy3.png?mtime=1332876792" width="963" height="682" /></a> </div> This one seemed slightly faster. I am not making any judgment and I guess that when you really need a decompiler some features are more important than others depending on your use case. My use case was to see the IL which only dotpeek did not provide. [1]: http://wiki.sharpdevelop.net/ILSpy.ashx [2]: /index.php/DesktopDev/MSTech/justdecompile-or-dotpeek

Read More...

Justdecompile or dotpeek

For my previous post I needed to see the IL and that was the time to try some of the new decompilers that are out there. I was thinking [dotpeek][1] by [jetbrains][2] and [justdecompile][3] by [telerik][4]. God knows I love dotpeek. So it was the first I tried. Dotpeek is still early access so far from ready. The install experience is none existing. You download the zipfile, unzip it. And then doubleclick on the exe to start it (if you can’t find it, it’s under the d for dotpeek).

Read More...

Contained Databases, Temporary Tables and Collations

In SQL Server 2012 we now can have Contained Databases. To be precise we now can have partially Contained Databases. The complete definition is found in the MSDN Database. In short a Contained Database holds it’s configuration and security information so you should be able to move these databases easily between different SQL Servers without having to create users or other configuration items. But as we all know Collations can cause serious problems, certainly if there is a difference between the Collation of the database itself and tempdb. So what happens if we create a Contained Database with a different Collation on a server? And does a Contained Database uses tempdb for it’s Temporary Tables? Let’s find out what happens with a normal database and after that wath happens with a Contained Databases.

Read More...

Initialize arrays in VB.Net – follow up

So in my previous post I got a comment from Brian. The declare and initialization syntax used above is generally frowned upon. Rather, you should split the two into separate pieces. Either of the following will give you a 0-sized array while being natural: ‘Full form Dim array1() As Integer = New Integer() {} ‘Shortcut Dim array1() As Integer = {} I don’t think that looks any better, but tastes differ. It’s just syntactic sugar anyway.

Read More...

Initialize arrays in VB.Net

This post was inspired by [this forumthread][1] on [VBIB][2] (dutch). Some people seem to forget that arrays in VB.Net are 0-based. Meaning that this. Dim array1(0) As Integer Console.WriteLine(array1.Count)``` This instantiates the array with one element in it. But there is nothing stopping you from creating an array with 0 elements in it. Appart from the fact that it seems a bit unnatural. ```vbnet Dim array1(-1) As Integer Console.WriteLine(array1.Count)``` And why would you do that? Why not just do. ```vbnet Dim array1() As Integer Console.WriteLine(array1.Count)``` Because the above will give you a NullReferenceException, that&#8217;s why. So doing the unnatural is perhaps the way to go if you really need an array that has no predefined size. [1]: http://www.vbib.be/index.php?/topic/10807-module-array-variabele/page__pid__59243#entry59243 [2]: http://www.vbib.be/

Read More...

Presenting "Filegroups: Putting the Pieces Together" for Chicago SQL Connections

It’s been a busy year already, but I’m just getting started! I’ll be presenting on Tuesday, April 3, 2012, at 6:00 pm, for SQL Connection Suburban Chicago. I’ll be giving my new favorite presentation, “Filegroups: Putting the Pieces Together”. Abstract: Every DBA must know how to create and maintain filegroups because they affect performance, maintenance, and security of your data. What are filegroups, and how do you use them? In this session, I’ll show you how to create filegroups, create objects in them, move objects to them, perform maintenance, and walk through piecemeal restores.

Read More...

Why You Should Volunteer for the PASS Summit Program Committee

As announced in the March 21, 2012 PASS Community Connector newsletter, PASS is looking for a few good volunteers for the 2012 Summit Program Committee. What is it, what do they do, and why should you care? The Program Committee is responsible for reviewing every abstract and every speaker that submits to speak at PASS Summit. Every. Single. One. Hundreds of abstracts are submitted by hundreds of speakers, so this is a lot of work! A great review of the process from 2011 can be found at http://www.sqlpass.org/Community/SpeakerResource/AbstractSelectionProcess.aspx. In 2011, the volunteers were divided into two groups: speaker review and abstract review. The speaker team was responsible for determining the credentials, experience, and quality of each speaker. The abstract team was responsible for reviewing each abstract for completeness, appeal, and level. Then, the sessions were chosen and a schedule was created. This resulted in the high-quality training the people who attended PASS Summit 2011 received. (Full disclosure: I was one of the speakers chosen. It was still an awesome conference.)

Read More...