Posted by Plamen Ratchev on 05/01/07 21:28
You are missing EXEC... It is optional only when you execute stored procedures that are the first statement in the batch. Just try: DECLARE @sql nvarchar(MAX) SET @sql ='SELECT foo FROM foostable' EXEC sp_executesql @sql HTH, Plamen Ratchev http://www.SQLStudio.com
[Back to original message]
Copyright © 2005-2006 Powered by Custom PHP Programming