Showing posts with label testdata. Show all posts
Showing posts with label testdata. Show all posts

Sunday, February 12, 2012

CAST/Convert and performance measurements

Has anyone any testdata on how long a cast/convert from varchar to other datatypes is taking. Is casting a large number of data a major problem for MSSQL 2000?This is what I know.

CAST is the old way that SQL used to change from one data type to another. CONVERT is the preferred method according Microsoft.

I've used CONVERT on tables with a couple hundred thousand rows and didn't really see a large degradation in performance.

Hope this helps.|||CAST has simpler syntax, CONVERT has more functionality. They both work fast, and if you look at the documentation for them you'll see that SQL Server will do many conversion implicitily, so that you don't even need to use CAST or CONVERT.

blindman