sql server use cte in multiple queries