lcTmp = 'TmpCalificaciones'
lcSp1 = 'SpInsertaMasivoCalificaciones'
*Creo la tabla temporal
=SQLEXEC(serverdb,"Create Table #"+lcTmp+" (IdEstudiante Integer, Idmateria char(2))")
*inserto 5 registros
=SQLEXEC(serverdb,"Insert Into #"+lcTmp+" Values (4,'04')")
=SQLEXEC(serverdb,"Insert Into #"+lcTmp+" Values (5,'05')")
=SQLEXEC(serverdb,"Insert Into #"+lcTmp+" Values (6,'06')")
=SQLEXEC(serverdb,"Insert Into #"+lcTmp+" Values (7,'07')")
=SQLEXEC(serverdb,"Insert Into #"+lcTmp+" Values (8,'08')")
CantRegistros = "'4'"
*Ejecuto mi SP
lccadena = "execute "+lcSp1+" &CantRegistros"
x=SQLEXEC(serverdb,lccadena)
***********************************************
*Este es el SP
CREATE Procedure SpInsertaMasivoCalificaciones @CantRegistros As Integer --OutPut
As
Insert Into Estudiantes(IdEstudiante, IdMateria)
Select IdEstudiante, IdMateria
From #TmpCalificaciones
if @CantRegistros = @@RowCount
return (3)
GO