July 3, 2015 at 5:26 am
Taking into performance point of view, is it better to use CAST instead of CONVERT
Take this for example,
SET @StartDate = CONVERT(DATE, @FromDate)
SET @EndDate = CONVERT(DATE, @ToDate)
Will it make any difference if I use CONVERT here
July 3, 2015 at 5:28 am
The choice isn't about performance. CONVERT allows you to specify the format code for the date, CAST doesn't.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 3, 2015 at 5:37 am
And if you'd like to see some test results: Cast vs Convert
A bit old,but i think still valid.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply