>>>cSqlCmd = "alter table MyTable alter column MyFld1 char(30); update MyTable set MyFld1 = repl('0',30) where len(MyFld1) = 0" >>>nRetunr = SQLEXEC(nConn, cSqlCmd) >>>>>>
text to cSqlCmd textmerge alter table MyTable alter column MyFld1 char(30); update MyTable set MyFld1 = repl('0',30) where len(MyFld1) = 0 endtext nRetunr = SQLEXEC(nConn, cSqlCmd)It runs the same, but it's much easier to maintain. Consider the case when your nReturnr goes over 20 (it's the number of returned cursors). You can send kilobytes of text in a SQL command, and retrieve many cursors all in one go. These kilobytes of TSQL script would be very hard to maintain if they were built with string concatenation. Text/endtext enables you to have a script laid out as text - with all the benefits of textmerge. My life would be much more complicated without it.