Hi,
I am new to TSQL and have a problem with temp tables
I get the following error "Subqueries are not allowed in this context. Only scalar expressions are allowed."
the variables are all defined and declared.
Any help appreciated.
I am new to TSQL and have a problem with temp tables
Code:
CREATE TABLE #TCOUNT( PASSED INT, FAILED INT )
INSERT INTO #TCOUNT(PASSED,FAILED)
VALUES (SELECT count(ID) FROM ExamResults er
WHERE (er.[lastresult] = @mark1)
AND ( er.[curresult] = @mark3 or er.curresult= @mark4 or er.[curresult] = @mark5)
, 1)
I get the following error "Subqueries are not allowed in this context. Only scalar expressions are allowed."
the variables are all defined and declared.
Any help appreciated.