• john.arnott (11/3/2011)


    Thank you for this mini-lesson in dynamic SQL. And don't fret too much over the minor glitches -- I know from experience that it's a lot harder than it looks to compose a QOD that no one finds anything to complain about.

    I agree, excellent question, I tend to use sp_executesql so I learned a lot about EXEC. I also agree with John about the minor glitches. I've put in a couple of QoDs and you have to expect complaints. If you read the discussions you will find that most QoDs have anything from a handful of complaints on up.

    Kenneth

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]