1
Answer

if exit table then drop query

Apurva Singh

Apurva Singh

7y
718
1
i am creating a procudure for temp table.
 
 
IF EXISTS (SELECT TEMP1.*,TEMP1.Total + (SELECT COALESCE(SUM(Total),0) FROM TEMP1 t1 WHERE t1.ROWNO<TEMP1.ROWNo)as TotalAmount FROM TEMP1
ORDER BY OrderID
)
DROP TABLE TEMP1
in this i am getting error,
The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.
 
please help me how to resolve this??? 
Answers (1)