```
DECLARE @count INT;
WITH CTE AS
(SELECT...)
SELECT @count = COUNT(ID) FROM CTE;
SELECT * FROM CTE

```

Can I use CTE table after first expression `SELECT @count = COUNT(ID) FROM CTE`? I get error `Invalid object name 'CTE'.`
I'm using SQL Server 2008.

Thanks