Thanks a lot. Other thing I found is that a statement must be terminated with a ; before a common table expression
declare @b int, @c varchar(20);
WITH Temptable AS
(
SELECT ID_prom, Name_prom
FROM TSSITE_Prominences_prom
)
select
@b = ID_prom, @c = Name_prom
from Temptable
Hello
Just starting with SQL and i'm experimenting with creating a temporary table and storing variables. I'm trying th efollowing code but I get an error "Invalid object name 'Temptable'."
Here's the code:
WITH Temptable AS
(
SELECT ID_prom, Name_prom
FROM TSSITE_Prominences_prom
)
select...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.