SQL Server, the story of a ROUND function inside a query
Hi Friends, Today is the day of the light post since tomorrow it’s Saturday: Light but interesting! Today I would show you a little example in order to see how much the execution plan of a Query may change by adding a simple ROUND function! We have only a rule: a post and a example! So, In order to do the simplest example I will use only very simple Queries: one Table and no join at all. Enjoy the reading! Round & Statistics For the example we will use the OrdRig table (do you remember.. is one of the tables we usually use for our examples). It contains the n rows of order So, take a look to this two Queries. select id from OrdRig where qta1 > 10000000 select id from OrdRig where qta1 > round (10000000,0) What do you expect to happen? Do they have the same result? Yes if course the result it is the same but take a look to the execution plan : If we apply the ROUND function then the exe...