A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Probably after the years the values of cdrid became greater than 2,147,483,647. If the column is bigint, then change int to bigint in your getcdrdetailsrange and other SQL scripts. Also make sure that the corresponding C# variables are long.