--Question you want to pass ONE Row or Multiple Rows?--For One Row:DECLARE @SchoolNumber AS VARCHAR(50) ,@SchoolName AS VARCHAR(50) ,@StudentNumber AS VARCHAR(50) ,@StudnentName AS VARCHAR(50) ,@StudentAddress AS VARCHAR(50) ,@Studentbirthdate AS DATE ,@StudentPhoneNumber AS VARCHAR(50) ,@GuardianName AS VARCHAR(50)SELECT TOP 1 @SchoolNumber=SchoolNumber ,@SchoolName=SchoolName ,@StudentNumber=StudentNumber FROM [Trans].[dbo].[Student] ORDER BY SchoolNumber ,SchoolName ,StudentNumberEXEC StudentData @SchoolNumber ,@SchoolName ,@StudentNumber ,@StudnentName OUTPUT ,@StudentAddress OUTPUT ,@Studentbirthdate OUTPUT ,@StudentPhoneNumber OUTPUT ,@GuardianName OUTPUT
-- and the stored procedure StudentData is define like thisCREATE PROCEDURE dbo.StudentData @SchoolNumber AS VARCHAR(50) ,@SchoolName AS VARCHAR(50) ,@StudentNumber AS VARCHAR(50) ,@StudnentName AS VARCHAR(50) OUTPUT ,@StudentAddress AS VARCHAR(50) OUTPUT ,@Studentbirthdate AS DATE OUTPUT ,@StudentPhoneNumber AS VARCHAR(50) OUTPUT ,@GuardianName AS VARCHAR(50) OUTPUTASBEGIN ....END
sabinWeb MCP