I love integers.
Furthermore, I think we’ve all been taking them for granted.
Integers are clean, elegant datatypes that do exactly what they’re supposed to. They’re the Golden Retrievers of the database world: they have a few shortcomings, but so, so few. And so for this month’s T-SQL Tuesday, I wanna share my love for integers with you.
1. Integers have clear contents right from the start.
You can declare an integer variable or column datatype, then set it to a string – and it’ll work great as long as the string can be converted into a number: