ALTER PROCEDURE [dbo].[PA_IngresarNotas]
-- Add the parameters for the stored procedure here
@nota numeric(4,2), @alumno char(4)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @nota1 varchar(10), @nota2 varchar(10), @nota3 varchar(10)
set @nota1= (select convert (numeric,(nota1)) from TA_Calificaciones where codAlumnoCalif=@alumno)
set @nota2 = (select convert (numeric,(nota2)) from TA_Calificaciones where codAlumnoCalif=@alumno)
set @nota3 = (select convert(numeric,(nota3)) from TA_Calificaciones where codAlumnoCalif=@alumno)
if(@nota1 = 'NULL')
update TA_Calificaciones set @nota1=@nota where codAlumnoCalif=@alumno
else if(@nota2='NULL')
update TA_Calificaciones set @nota2=@nota where codAlumnoCalif=@alumno
else if(@nota3='NULL')
update TA_Calificaciones set @nota3=@nota where codAlumnoCalif=@alumno
else
print 'Ya Tiene todas sus Notas Ingresadas'
END