me lleva....
Código SQL:
Ver originalSET @querycafe1 = 'SELECT ' + @fieldname + ' INTO #temp1 FROM #del d'
SET @querycafe2 = 'SELECT ' + @fieldname + ' INTO #temp2 FROM #ins i'
EXEC(@querycafe1)
EXEC(@querycafe2)
SELECT @valorviejo=campo FROM #temp1
SELECT @valorNuevo=campo FROM #temp2