SQL
SQL Server T-SQL LPAD & RPAD Functions (String Padding Equivalent to PadLeft & PadRight)
Here is my method for achieving string padding in the Microsoft SQL Server T-SQL language. Unfortunately T-SQL does not offer functions like Oracle PL/SQL's LPAD() and RPAD() and C#'s PadLeft() and PadRight() functions. However, you can achieve the same thing using the T-SQL REPLICATE and LEN functions.
Thinking in Sets
Coders think in terms of code. It's the old saw about the hammer. When that's the only tool you've got, everything starts to look like a nail.
Coders, of course, have more than one tool at their disposal. We have worlds of tools. But coders do like to code (see Andy's recent post if you don't believe me). It's what we like to think we do best.
Before I get too far along here, let me clarify what I mean by code. I argued for a broad definition of source code in a recent comment, and I'm not backing away from that really, but maybe clarifying a few terms. Let's say, for the sake of argument, that code is that which is written in a programming language such as BASIC, C, Java, and the rest. I won't attempt to define it further. And let's say that what I called "source code" in that other post might better be called simply "source." Only three paragraphs into my post and I've already gone off on a tangent. Typical.
The point I want to make here is that coders like to work in familiar territory. Present a coder with a problem and his or her mind will immediately go to work on solving that problem in the software language of his or her preference. For example, if you present me with a problem, I'll probably start right away with a possible solution using Java and some of my recent favorite technologies, such as Hibernate, SOAP, and maybe JMS. Java is my favorite hammer and I like to use it.
But many many problems are not best solved by building a mighty computer program, as I recently learned.


Recent comments
3 weeks 6 days ago
3 weeks 6 days ago
38 weeks 5 days ago
39 weeks 4 days ago
39 weeks 4 days ago
40 weeks 4 days ago
41 weeks 1 day ago
41 weeks 1 day ago
41 weeks 3 days ago
41 weeks 4 days ago