Up until now my routines have always called a stored procedure to transfer or dump data. Now however, I need to know how to make a SELECT statement and obtain the results within my program/app. Also, I need to know what the basic error trapping code is. In other words, if the SELECT statement fails for any reason, or if a subsequent sp call fails, how would I know?
To further clarify this senario, I would:
1) issue a SELECT statement to table_1
2) store the results in variables
3) based upon the results, create a string using those variables
4) call SQLExecDirect() to transfer the data to table_2
Again, if an error occurs with either step 1 or step 4, I need to know.