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.

SQL Server collation conflicts

Collations control how strings are sorted and compared. Sorting is not usually a problem because it does not cause collation conflicts. It may not sort the way you want it to, but it won’t cause errors. The real problem here is when you compare data. Comparisons can occur several different ways. This can be a simple comparison in a where clause, or a comparison in a join condition. By having columns in your database that do not match the default collation of the database, you have a problem just waiting to happen.

Read More...

Don't use text datatype for SQL 2005 and up

With SQL Server versions prior to SQL2005, the only way to store large amounts of data was to use the text, ntext, or image data types. SQL2005 introduced new data types that replace these data type, while also allowing all of the useful string handling functions to work. Changing the data types to the new SQL2005+ equivalent should be relatively simple and quick to implement (depending on the size of your tables).

Read More...

Pushing Silverlight for my Company

Hey everyone, It's me again, Rick the Silverlight nut. I've been buried under a pile of work this last month and haven't had a chance to post much of the fun stuff I've been working on. But I've got a few minutes to write about my last big project. So I give you, the story of KBay: The Story So Far… I work for Kerry Americas, a food product company with a corporate office in Beloit, Wisconsin.

Read More...

Do not use the float data type

That may seem a little harsh, and it’s not always true. However, most of the time, the float data type should be avoided. Unfortunately, the float (and real) data types are approximate data types that can lead to significant rounding errors. How to detect this problem: Select Table_Name + '.' + Column_Name As Name, 'Table' As ObjectType From Information_Schema.Columns Where Data_Type in ('Float', 'Real') UNION ALL SELECT Name, Types.Description FROM ( SELECT S.

Read More...

Undetectable Distributed Deadlocks

I believe I have discovered a deadlock situation that SQL Server is not able to detect, so a perpetual block occurs. A deadlock is nothing more than mutual blocking. Blocking is when a process is forced to wait for a resource while another process exclusively accesses it (where the exclusivity is managed through locks). Mutual blocking is when both processes have a lock on a resource the other is asking for.

Read More...

Beginning stages of a DR plan for SQL Server

I’ve found that many companies find out what true Disaster Recovery is only in the presence of a true disaster. Obviously this is not a very optimal time to start thinking about what could have done to keep the money flowing through the veins of the company. In the near future I will be writing a series based around DR. The series will be mostly geared towards your SQL Server instances and some tricks and tips to make recovery quicker for you.

Read More...

Identify procedures that call SQL Server undocumented procedures

When you use an undocumented stored procedure, you run the risk of not being able to upgrade your database to a new version. What’s worse… you could have broken functionality and not even know it. With undocumented stored procedures, Microsoft may not document when they decide to deprecate it, so you may not know about your broken functionality until it’s too late. Presented below is a hard coded list of undocumented stored procedures.

Read More...

Back to business for the SQL Server community

The countdown to PASS has officially reset. Good news is we have under 365 days to go until the next PASS. Bad news is we have just under 365 days to go. It’s been great watching the tweets and laughs going back and forth from new friendships made there this year. Although I didn’t have the chance to make it to PASS this year, I want to thank everyone that put so much into making it one of the most eagerly awaited yearly events.

Read More...

OUTER JOIN order

I’m almost embarrassed to publish this but I have operated for years under a false assumption that I only recently discovered to be untrue. Or, to perhaps state it better, to be unnecessary. When using an outer join, I have always tended to put the ON operators in the order of the join itself. So, for example, if my first table in a left join was table1, then my ON operators would always be table1.

Read More...

SSRS 05 Passing Multi-Value Parameters Between Reports.

So today I had some fun with a report. I had to set up a report that had links to some graphs, but I needed to pass the multi-value parameters to the graphs. Awesome. This took me roughly an hour to set up (with googling and messing around trying to get it to work). My eventual set up seems a little less intuitive than I thought it would be, so here I am documenting what I did.

Read More...