Devo modificare una vista e voglio introdurre 2 tabelle temporanee prima di SELECT.È possibile creare una tabella temporanea in una vista e rilasciarla dopo selezionare?
È possibile? E come posso farlo?
ALTER VIEW myView
AS
SELECT *
INTO #temporary1
SELECT *
INTO #temporary2
SELECT * FROM #temporary1
UNION ALL
SELECT * FROM #temporary1
DROP TABLE #temporary1
DROP TABLE #temporary2
Quando si tenta questo si lamenta che ALTER VIEW deve essere l'unica affermazione nel batch.
Come posso ottenere questo risultato?
Grazie
Perché non basta unire le istruzioni selezionate ad ogni tentatore? –