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.

The mystery of Clay and VB.Net a better explanation

Introduction Over the last 2 days I played with Clay because a certain Scott Hanselman posted about it. I found it to work mostly in VB.Net too apart from the anonymous types. That kinda intrigued me and I posted it on Stackoverflow but did not get a good answer yet. So then I contacted the VB-team via their blog. And I got a reply from Lucian Wischik Spec Lead for Visual Basic.

Read More...

The mystery of Clay and Anonymous types in VB.Net

Introduction Yesterday I made a post about using Clay with VB.Net. Clay works but not all functionality we have in C# work in VB.Net, which is mildly frustrating. To see if I could find a solution I posted a question on StackOverflow. But no solution yet. The problem This works in C# text dynamic c = new ClayFactory(); var plant = c.Plant(new {LatinName = "test"}); Console.WriteLine(plant.LatinName); Console.ReadLine(); but this does not work in VB.

Read More...

Removing OS Files Through a Stored Procedure

Deleting OS files from a stored procedure:   Here is one way to remove old backup files from the OS through a stored procedure. The procedure can be compiled in any database. Once compiled you can run the stored procedure from a scheduled job to remove old backup files from the OS.  IFEXISTS(SELECT [name] FROM dbo.sysobjects WHERE [name] = 'usp_Delete_OS_Files_By_Date' AND TYPE = 'P') DROPPROCEDURE dbo.usp_Delete_OS_Files_By_Date GO CREATEPROCEDURE dbo.

Read More...

Using clay in VB.Net or how to be dynamic

Introduction Today Scott Hanselman did a post about NuGet Package of the Week #6 – Dynamic, Malleable, Enjoyable Expando Objects with Clay and allthough Scott is slightly awesome, he is not awesome enough to add VB.Net samples. So I contacted him and asked if I could do that for him. And here I am. Clay I will refer you to Scott’s post on how to get Clay, it only takes seconds with Nuget.

Read More...

SQL Server Database Administration Tip a Day Series

Over the next month, with a few days change, LessThanDot will be posting, "DBA Tip a Day Series" for SQL Server Database Administrators. The hopes of this series of blogs and articles will be to assist anyone that is starting out in SQL Server and also DBAs with vested years of experience to gain more knowledge. The list of tips includes topics such as Memory, CPU, I/O, Baselines, Security Auditing, and even Professional Development.

Read More...

Match your defaults with your trigger values to prevent horrible fragmentation on your indexes and tables

Here is a quick demonstration that shows you what can happen when you use defaults that are much shorter than the value that is updated from an insert trigger. The ModifiedBy column has a default of “ but in the trigger it gets updated to ‘SomeapplicationName used by ’ +SUSER_NAME(). Ideally you want the default to also be ‘SomeapplicationName used by ’ +SUSER_NAME() Let’s take a look, first create the following table

Read More...

Presenting for PASSMN May 17th

May 17th I have the distinct pleasure of presenting for one of the strongest SQL Server User Groups around; PASSMN (Minnesota SQL Server User Group).  Visiting this user group has an added bonus of me being the Regional Mentor for the area. It isn’t very often I am able to attend in person the user groups that I stay in contact with for the mentorship program. I hope to use this to build more personal relationships with the groups.

Read More...

SQL Server DBA Tip 9 – SQL Server Monitoring – Default Trace

The Default Trace exists in SQL Server 2005 and higher versions, in all editions. The trace has been questioned: what is it, and why is it helpful? We will go over the answers to these questions and look into the Default Trace, showing how to use it to retrieve information it collects while enabled. What is the Default Trace? The Default Trace is a trace prepackaged into SQL Server and enabled by default when you install SQL Server.

Read More...

From Eli's Shelves: Books for Developers

There are times in our careers where we have to branch out and learn more than just the next technology or tools. After a few years we find that the difference between junior and senior, getting by and excelling, is not just learning new technologies and tools, but also learning from our experiences and the experiences of others. For the next few weeks I’ll be posting book selections from my home shelves.

Read More...

SQL Server DBA Tip 8 – Server Monitoring – Baseline

Troubleshooting any type of problem can be stressful and tedious. SQL Server performance issues are no exception. If an instance of SQL Server suddenly shows a spike or immediate bottleneck with one or many resources, determining the cause of that spike can test any DBA’s patience. What can make troubleshooting a performance problem in SQL Server more confusing is the lack of a true baseline. A baseline can be any set of metrics that have been recorded about SQL Server.

Read More...