title: SQL Server: get top xx blog record from Umbraco by parameter
body: <p>Following SQL get what I need:</p>
  
  <pre><code> SELECT TOP (50) [nodeId] 
   FROM [dbo].[cmsContentXml] 
   WHERE [xml] like '%creatorID="29"%'    
     AND [xml] like '%nodeType="1086"%' 
   ORDER BY [nodeId] DESC
  </code></pre>
  
  <p>I need to pass in the numbers as parameters, so I have follows:</p>
  
  <pre><code>exec sp_executesql N'SELECT TOP (@max) [nodeId] FROM [dbo].[cmsContentXml] WHERE [xml] like ''%creatorID="@creatorID"%''    AND [xml] like ''%nodeType="@nodeType"%'' ORDER BY [nodeId] DESC',N'@max int,@creatorID int,@nodeType int',@max=50,@creatorID=29,@nodeType=1086
  </code></pre>
  
  <p>which however, returns no record, any idea?</p>