... lcStr = FileToStr(tcSqlScriptFile) DO WHILE Not Empty(lcStr) lnGoPos = AT("GO" + CHR(13)+CHR(10), UPPER(lcStr)) lcSqlScript = LEFT(lcStr, lnGOPos-1) lcStr = SUBSTR(lcStr, lnGoPos + 4) llOk = ( SqlExec(lnConn, lcSqlScript) > 0 ) IF Not llOk * Error ... ENDIF ENDDOKeep in mind that it's incomplete sample code. You'll have to adjust it for your needs.
>if exists (select * from sysobjects where id = object_id('sp_test') and sysstat & 0xf = 4) > drop procedure sp_test >go >Create Procedure sp_test >as >select GetDate() as DateTime >go >--Exec sp_test >>
>SqlCmd = FILETOSTR('C:\Projects\IMS\Sql\Procedures\sp_test.sql') >RetVal = SQLEXEC( ConNumber, SqlCmd, "" ) >IF RetVal < 0 > =AERROR(aErrorArray) && Data from most recent error > FOR n = 1 TO 7 > ? n,aErrorArray(n) > ENDFOR >endif >>
>Line 4: Incorrect syntax near 'go'. >>