This month's T-SQL Tuesday is hosted by Bradly Ball (blog | twitter) and the topic is second chances. The idea is to pick one of those moments in our career we wish we could do once again. A second chance to make it all better, or at least to make us sleep a little better at night. So here goes...
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.
Because of a job change next week I have no need for Oracle anymore, I decided to remove it. I know that some people complain that uninstalling SQL Server is a pain, well those people should just be quiet from now on, uninstalling Oracle is much worse. In order to uninstall Oracle, you need to run the Oracle Universal Installer. Once you run it, click on the Deinstall Products button
I have a listbox on a form that gets some data from a service that is slow, I mean a whole 500ms slow. That is unacceptable. The data is not very critical so I can load it in the background. This easy. Private Sub LoadList(ByVal id as Integer) Task.Run(Sub() 'Do something slow RaiseEvent TellTheUIWheAreReadyAndThatItHasNewData(ByVal newList as IList(Of CoolThing)) End Sub) End Sub``` The UI will update when the Task has run. Of course when the user rapidly goes from one record to the next. It might see some strange things, since tasks will still run one by one. There is actually nothing that says the data will be the correct data, since we are using threads and we don’t know which thread will finish first. Yeah, threading is easy. So we would need to cancel our previous task if it is still running. That is easy. ```vbnet Private cts As CancellationTokenSource Private Sub LoadList(ByVal id As integer) If cts IsNot Nothing Then cts.Cancel() End If cts = New CancellationTokenSource Dim token = cts.Token Try Task.Run(Sub() 'Do something slow token.ThrowIfCancellationRequested() RaiseEvent TellTheUIWheAreReadyAndThatItHasNewData(ByVal newList as IList(Of CoolThing)) End Sub, token) Catch ex As OperationCanceledException Log.Debug("Operation cancelled") End Try End Sub``` So I need a CancellationTokenSource which I need for it’s token and I pass that token to the task. Next time I run that code I will just be default cancel the task, if it is no longer running it won’t matter, And if it is it will cancel before it can inform the UI that it has something new or preferably somewhere before that, you can set that ThrowIfCancellationRequested anywhere you like. Or you could use the IsCancellationRequested from the token and forget about the Try/Catch around it. Something like this. ```vbnet Private cts As CancellationTokenSource Private Sub LoadList(ByVal id As integer) If cts IsNot Nothing Then cts.Cancel() End If cts = New CancellationTokenSource Dim token = cts.Token Task.Run(Sub() 'Do something slow If Not token.IsCancellationRequested() Then RaiseEvent TellTheUIWheAreReadyAndThatItHasNewData(ByVal newList as IList(Of CoolThing)) End If End Sub, token) End Sub``` Get it? Good. Let’s move on.
On Monday the 3 monthly password change happened and the account I use for testing this application also had it’s password changed. Oh joy. This is an app that uses windows authentication but my test server has an identity impersonate to make sure it always uses the same account. Which is not the account I use to develop on my machine. Anyway. I noticed that the password was wrong because of this.
Oh wait sorry, I meant SSDT. Or was it SSDTBI? To avoid confusion about the developer tool to create BI solutions, Microsoft has changed its name a few times. You know, to make it less confusing. Here's a nice overview: BIDS or Business Intelligence Development Studio. The most non-confusing name of the bunch. This piece of software was delivered to you when you installed SQL Server 2005, SQL Server 2008 or SQL Server 2008 R2. SSDT or SQL Server Data Tools. Introduced with SQL Server 2012. However, you have a tool with the same name for creating database projects, which you had to download and install separately (don't get me started on which names this tool had before. Mildly schizophrenic to say the least.) This development environment uses the Visual Studio 2010 shell and you use it to build BI solutions solely for SQL Server 2012. So two tools with the same name. One for database projects, one for BI projects. One to download, one that came with the SQL Server install media. Enter confusion. Read more about it on the blog of Jamie Thomson (blog | twitter): More SSDT naming confusion. Also read his blog posts about the database project part of SSDT, they are mighty interesting. SSDTBI or SQL Server Data Tools – Business Intelligence. In an effort to swiftly put a stop to all this confusion, SSDTBI was released with Visual Studio 2012. It's basically still BIDS – or SSDT from the SQL Server installation media – but now with BI appended to make its purpose more clear. This environment uses the Visual Studio 2012 shell obviously, but is still used to create BI solutions for SQL Server 2012. Great deal of fun when you have two developers on the same project: one with SSDT (Visual Studio 2010) and one with SSDTBI (Visual Studio 2012). Each tool exists in two flavors: either you already have Visual Studio and the BI templates are installed into your existing installation, or you don't have Visual Studio and SQL Server install a shell for you, only capable of creating BI solutions. Less confusing now? OK, let's move on to the real point of this blog post: which development environment do we use in SQL Server 2014 CTP1? (Which is just released in case you missed it)
With almost all databases running on SQL Server, at some point there will be a need to load data, move data or delete data from tables that are not ideally setup for the operations in large batch sizes. While many methods exist to handle the actual task of any of these needs, a commonly overlooked side effect of performing large batch operations is, transaction log growth. For over a decade now, one of the most commonly answered questions on the community forums and all around is, “My transaction log grew out of control and I need to reclaim my disk space. How do I prevent this?”
I was asked the other day, “Is there really a difference in performance loading data into newer versions of SQL Server in the same process?” The question really has many variables that need to be answered prior to even considering an answer. Such variables are the data architecture, I/O setup for each, loading method such as bulk loading, SQL database and SQL Server Instance configurations, pipe and network latency, and on. As you can see, to really answer this, you need to take much into account.
Last week my colleague Valentino and I did a session on Data Visualisation Tips & Tricks at the Belgian Community Day. At the beginning of the session there were only a handful of people in the room but luckily we quickly realized the keynote was running over time. So after the keynote speaker finally wrapped up his talk, our audience steadily grow to about 60 people which exceeded our expectations. Valentino's demos didn't fail, I didn't fall of the stage and I heard good feedback, so we're safe to say our session was a bit of a success.
Visual Studio 2013 Preview, Visual Studio 2012 Update 3 and .NET Framework 4.5.1 are available for download You can download the following versions of Visual Studio 2013 Preview Visual Studio 2013 Preview Visual Studio Ultimate 2013 Preview Visual Studio Premium 2013 Preview Visual Studio Professional 2013 Preview Visual Studio Test Professional 2013 Preview Team Foundation Server 2013 Preview Visual Studio Express 2013 Preview Visual Studio Express 2013 Preview for Web
If you want to try out Windows 8.1 preview right now, you can. Be aware that when you install Windows 8.1 preview that you will have to reinstall all your apps. If you then upgrade to the final RTM version you will have to do this again. Going from Windows 8 to Windows 8.1 RTM does not have this reinstall requirement nonsense You can download Windows 8.1 preview here http://windows.microsoft.com/en-us/windows-8/download-preview To see what is new in Windows 8.1, check out the Windows 8.1 Preview Product Guide.