dynamic SQL needs to be parsed before execution each time whereas a stored procedure generates an execution plan which it reuses each subsequent execution improving its performance.
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)
And dynamic sql needs user permissions on the objects
======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
And dynamic SQL can result in run time errors as every possible sQL statemetn will not be tested. If you can do something without dynamic SQL, you should.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.