jump to navigation

Data type and conversions December 7, 2012

Posted by msrviking in DBA Rant, Performance tuning, T-SQL.
Tags: , , , ,
add a comment

Today I downloaded SQL Server Data Type Conversion Chart from this location. I remember this chart very well and its available on BOL that would have been installed on your system or on MSDN online.

As soon as I saw the chart, it reminded me days where I used to explain to the development on its importance and always push the developers, leads to have a look on this topic in BOL. Today I am going to tell the teams whoever use SQL Server to download this and stick it around as long as they are on development side of database.

One of the points that I leave with the teams is

“Make sure you don’t have variables declared in your code that cannot match the data types that are designed in the tables. This would mean implicit conversions by query engine and when this happens it could lead to performance problems, deadlocks.”

There had been several situations where performance reviews and fixes ended by just change of variables data types in the T-SQL code. I don’t think I am going to stop sharing this point anytime, anywhere to developers forum whatsoever. There are experienced folks who do this mistake even today, and one can’t get rid of basic mistakes unless its part of practice. Practice has to be diligent, and has to be cultivated.

So if you see anyone writing a piece of code that could hit your performance benchmarks badly, please don’t hesitate to give this piece of advice again.

Let me know what you think.

Cheers and Enjoy!

Advertisements

2 months gone..no posting May 27, 2010

Posted by msrviking in T-SQL.
1 comment so far

I had been kind of busy with several things running together, so couldn’t talk anything all these days. I am not sure on what will happen in next few months. Anyways, I thought this will be a good start once again to share my readings, knowledge with you all. What is it?

I happen to read this entry, and a good one written by SQL Server Engine Team few years ago. This question keeps coming to my mind quite often whenever I see or I am asked about ISNULL and COALESCE. I hope this link helps you all too.

http://blogs.msdn.com/sqltips/archive/2008/06/26/differences-between-isnull-and-coalesce.aspx

*Please note the information shared is only with the intention to share with the community on what I find.

Cheers!