title: CTE execute commands before using the CTE Table
body: <p>Is there a way to write any kind of code before selecting your CTE table ?</p>
  
  <pre><code>DECLARE @TestTable TABLE (ID INT ,name NVARCHAR)
  INSERT INTO @TestTable VALUES (1,'a'),(2,'b'),(1,'c')
  ;WITH TempCte(name)
  AS
  (
  SELECT name FROM @TestTable WHERE ID = 1
  )
  PRINT 'test'
  SELECT * FROM TempCte
  </code></pre>