Obviously you haven't read this guy's previous posts. It is 100% NOT homework. He'll be asking how to get values returned from a cursor looping through tables defined by a variable within that loop next.
Yes I did read the dynamic sql link...Allthnks to u I came to know about SQL Injection but in the above case the DBName is not accepted by user..It's the (I mean my)prog. which takes this so I think using EXEC in the above query should not be a prob.Is there any other Problem in the above query?
Waiting for ur reply