I thought I'd make things easy for myself by writing a stored proc to
generate another stored proc based on a view. The generated code looked ok
and was successfully put into the server (SQL Server 2k). The problem was
that it did not actually do anything. After most of the day going through
possible causes of the error and effectively re-building the SP by hand
(which worked) I discovered that in the generate SP I was using CR
[char(13)] and simply changing it to CRLF [char(13) + char(10)] worked.
I can only assume that this is a bug. If SQL is going to reject the proc
based on the non-standard CRLF then that's ok but silently accepting the SP
and not running it is some what annoying.
adam