I did such things using stored procedure call by sring. If code of your procedure is less than 8000 characters, this will work pretty well. I made SP with fixed parameters firts, tested it well, than changed all to a single huge assignment to character variable with insertions of parameter replacements. Looks weird after that in my query analizer, but it works.
>I need to write a procedure that receives a database name as a parameter. The procedure must:
>
>1) look up some information (several fields) from that database (+ a known table name) and store it in variables (or something)
>
>2) do further processing with those values in the main procedure.
>
>The problem is that in order to do #1, I must use dynamic SQL - and I see no way to "get the information back out" of that dynamic SQL execution for use in the rest of the main procedure. Any variables I try to assign are "local" to the dynamic SQL execute as are any temp tables I create. I could create a global temp table, but that is not my preferred choice.
>
>How do you do this?
>
>TIA!
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.