Tag Archives: mssql

Last week I finished with desing and implementation of tournaments feature of our social game about army.
Taking just raw idea of the tournament I’ve done both the server side (C#.NET+MSSQL) and the client side (Flash+ActionScript3), communication protocol, designed gameplay workflow and formalized details of UI for artist to make art. As result, there is a nice feature in the game.

One more time I have ability to prove the ability to work very productive as both the client side and the server side developer beyond the opinion of other people who claimed that it’s impossible.


There are 4 methods to truncate time part of the datetime value:

  • cast(convert(varchar, d, 101) as datetime)
    Avg. execution time: 1470
  • cast((str( year( d ) ) + ‘/’ + str( month( d ) ) + ‘/’ + str( day( d ) ) ) as datetime )
    Avg. execution time: 6373
  • cast(floor( cast( d as float ) ) as datetime )
    Avg. execution time: 554
  • dateadd(day, datediff(day, 0, d), 0)
    Avg. execution time: 525

As we can see last one is the most efficient way.
Because it doesn’t use string operations but numeric ones.