SqlSendCmd%

Sends Transact-SQL text from the command buffer and sets up the statement for processing. This utility combines several functions into a single call.

Syntax

SqlSendCmd% ( sqlconn%, cmd$ )

where

sqlconn%
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%.
cmd$
Is a character string to be copied into the command buffer.

Returns

SUCCEED (1) or FAIL (0).

Remarks

SqlSendCmd% performs several actions that process the Transact-SQL statements in the command buffer. SqlSendCmd% is equivalent to calling SqlCmd%, SqlExec%, and SqlResults%. SqlSendCmd% prepares the command for processing the first set of results but does not retrieve the first data row.

Example

'Put commands into the command buffer.
cmd$ = "SELECT db_name(dbid), dbid, size FROM sysusages"
cmd$ = cmd$  " ORDER BY dbid"

'Send commands to SQL Server and start execution.
Result% = SqlSendCmd%(SqlConn%,Cmd$)

See Also

SqlCmd%, SqlExec%, SqlResults%