Using Macros to Produce User-defined Constructs in Transact-SQL
Abstract
How often have we, as SQL programmers, written convert(int,tab_1.col_1) when what we really meant was atoi(tab_1.col_1)? Wouldn't it be nice if we could write a function in Transact-SQL called strtok() which on successive calls, returns all tokens in an input string separated by characters from a specified set of separators. Wouldn't it be nice if we could write any kind of function in Transact-SQL? And how about global constants? In this paper we look at m4, a macro expander available for UNIX systems, and show how it can be used to solve these programming problems.
pletch@mcs.newpaltz.edu

Go forward to Introduction