How to write dynamic statement with way do it run quickly?

hi

please see this below link ..

it may help !!