Is there a table called PivotExample in the database? If there is, check the writing and the owner and replace dbo with proper owner and correct possible differences in spelling.
If the PivotExample is just the alias you have used in the previous query, you cannot reference a query executed earlier. Executing a query does not create any permanent object into the database meaning that after the query is executed the aliases exit no more.
If the latter is the case, you need to embed a full, proper query inside the @SQLQuery variable.
It's a good idea to use
PRINT[
^] to see what's inside the variables so you can capture the statement and try running it.