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.

Winforms richtextbox and a memoryleak

Introduction I use a few richtextboxes to show some information on a screen. That information gets refreshed every 10 seconds. This application runs 24⁄7 and I don’t want to spend more time on it than the bare minimum. It’s cool to have but not business critical. The problem was that it had a small memoryleak. The problem The problem, it turns out, is that the richtextbox retains an unlimited amount of undo information.

Read More...

SQLAzure – My First Cloud

This past weekend I made my first foray into SQL Azure. SQL Azure has been on my list of “to learn” technologies and lately it made it closer to the top. While I had picked up some knowledge from random links in the twitter-sphere, I hadn’t made a concerted effort to learn about it yet. I started with a site named Microsoft Virtual Academy. This site (despite some usability issues with the dialog boxes prior to signup) offers a number of virtual “courses” that consist of links to external resources grouped into modules, each of which finishes with a short assessment.

Read More...

SQL Server DBA Tip 13 – SQL Server built in DR/HA Solutions

SQL Server has several options available for a stable DR/HA solution at a minimal cost. There is a grey area in which the time to start looking to products from third party vendors may allow more manageable DR/HA solutions. This grey area typically becomes more prevalent when database size grows or geographical distance is added to a SQL Server landscape. However, the features in SQL Server can scale to the higher percentages of database size that DBAs are handling.

Read More...

Raise your hand if you have seen code that sends email from within a trigger in SQL Server

Please leave me a comment if you have written or have seen a trigger that is written in such a way that it will send an email when a value changes in a table. I am looking at the following question: Email trigger when data is changed ALTER TRIGGER [dbo].[RVABestellingenAantalWijzigenTrigger] ON [dbo].[RVA_Bestellingen] AFTER UPDATE AS --Vars DECLARE @body varchar(500) DECLARE @BestellingID int DECLARE @CategorieID int DECLARE @SubCategorieID int DECLARE @AantalOrigineel int DECLARE @AantalNieuw int DECLARE @LocatieNaam varchar(255) DECLARE @ComponentNaam varchar(255) DECLARE @CategorieNaam varchar(255) DECLARE @SubCategorieNaam varchar(255) DECLARE @Datum datetime if update(Aantal) /*and (SELECT Datum FROM inserted) = cast(floor(cast(dateadd(day,1,getdate()) as float)) as datetime) */ and (convert(varchar,getdate(),108)>'11:00') begin --Zetten aantallen SET @AantalOrigineel = (SELECT Aantal FROM deleted) SET @AantalNieuw = (SELECT Aantal FROM inserted) SET @BestellingID = (SELECT BestellingID FROM inserted) SET @CategorieID = (SELECT CategorieID FROM inserted) SET @SubCategorieID = (SELECT SubCategorieID FROM inserted) --Zetten locatienaam en componentnaam SELECT @LocatieNaam = ('RVA Aanpassingen Locatie: '+LocatieNaam), @ComponentNaam=OfficieleNaam, @Datum=Datum FROM RVA_Bestellingen r LEFT OUTER JOIN Locaties l on l.

Read More...

SQL Server DBA Tip 12 – SQL Server Tuning – Missing Index DMV

Prior to SQL Server 2005, determining index needs was a much more intense process. The use of tracing and reviewing queries running on SQL Server would have to be performed. In SQL Server 2005 and on, DMVs have been added which make the process more efficient and stable. Determining index needs can be done with a query instead of a resource consuming process. With these new abilities, another ugly practice arose out of SQL Server; applying all the indexes the DMVs said to apply.

Read More...

Transaction Log: VLF's, Auto Growth and Performance

Recently I presented at SQLSat 83 about VLF’s and their performance impact on our databases. I decided to write this post as well for everyone who couldn’t make it all the way to Johannesburg, South Africa. To provide a bit of history on the subject, I was tasked in March to evaluate a server which came under severe strain. After investigating the numerous issues from insufficient memory to slow internal disk space ( raised alerts in SQL log, and monitoring some of the buffer and memory counters in perfmon), I came to the intermediate solution to redo the log allocation.

Read More...

SQL Server DBA Tip 11 – SQL Server Configuration – MIN Memory

Tip 11 of this series is being added in as the topic has come up during the series on several occasions. Specifically, the question was raised on the Twitter hash tag #SQLHELP of, “What are some good use-cases where setting min-server memory makes sense?” There really isn’t an answer to this question other than: the minimum memory value should always be set given the physical resources. We’ve discussed the importance of setting the MAX Memory value.

Read More...

T-SQL Tuesday #18: A Recursive CTE Is: A Recursive CTE Is

![][1] Welcome to T-SQL Tuesday #18, hosted by Bob Pusateri (blog | twitter). Bob, thanks for hosting. From past experience, I know it takes time and effort. Bob asked us to write about something I embraced many years ago: Common Table Expressions (CTEs). “Have you ever solved or created a problem by using CTEs? Got a tip, trick, or something nifty to share? I’d love to see your posts about any of the above.

Read More...

Printing to a zebra printer in VB.Net even when on Windows 7

Introduction I did a post about printing to a zebra printer many moons ago (I had more hair back then). The Zebra printers I had (those are label printer if you really want to know) were connected to several windows xp machines. I use the EPL method because it is much faster than using windows printing on theses machines. Yesterday I installed Windows 7 on those machines. And that caused the previous function to not work anymore.

Read More...

SQL Server DBA Tip 10 – SQL Server Reporting – Offload the reporting factor

A primary purpose of retaining data is to view that data at some point. Even when database servers have a largely OLTP basis, the need to retrieve data from the database will arise. Retrieving data in some manner is referred to as reporting. This reason the term reporting is defined here is to focus on the concept of reporting as something not only done with a feature like SQL Server Reporting Services.

Read More...