>Hi Naomi, thanks for your time, once I have the table names in my cursor how do I then perform my deletes using this cursor? say my query returns 10 records how do I loop through them ? In Fox it would simply be a scan and a "Delete from (cursorrow.tablename) where ??? etc... How do I code this ? Hope this makes sense
You will need to use dynamic SQL, in other words, generate your SQL command and then execute it using
sp_executeSQL stored procedure.
Take a look at some samples in this blog and blogs referenced in it
How to get information about all databases without a loop
If it's not broken, fix it until it is.
My Blog