@
@Roberto
I have this sp:
/* Definisco la stored procedure dbo.upI_AddStudent */
ALTER PROCEDURE dbo.upI_AddStudent
(
@FirstName varchar(10),
@LastName varchar(10)
)
AS
DECLARE @NextID int
/* Calcolo l'ID */
SELECT @NextID =
CASE
WHEN MAX(CAST(RIGHT(StudentID, 5) AS int)) IS NULL THEN 1
ELSE MAX(CAST(RIGHT(StudentID, 5) AS int)) + 1
END
FROM dbo.Students
/* Inserisco lo studente */
INSERT dbo.Students VALUES(
'P-' + RIGHT('0000' + CAST(@NextID AS varchar(5)), 5),
@FirstName,
@LastName
)
RETURN
it is possible to pass to the two parameters with two controls in one mask
you would make an example?
thanks
ciao
/* Definisco la stored procedure dbo.upI_AddStudent */
ALTER PROCEDURE dbo.upI_AddStudent
(
@FirstName varchar(10),
@LastName varchar(10)
)
AS
DECLARE @NextID int
/* Calcolo l'ID */
SELECT @NextID =
CASE
WHEN MAX(CAST(RIGHT(StudentID, 5) AS int)) IS NULL THEN 1
ELSE MAX(CAST(RIGHT(StudentID, 5) AS int)) + 1
END
FROM dbo.Students
/* Inserisco lo studente */
INSERT dbo.Students VALUES(
'P-' + RIGHT('0000' + CAST(@NextID AS varchar(5)), 5),
@FirstName,
@LastName
)
RETURN
it is possible to pass to the two parameters with two controls in one mask
you would make an example?
thanks
ciao