Using a the result-set of a query as a parameter in a stored proc invocation?

Yeah, I don't think you can use a subquery as a parameter to a stored procedure. The spec for the EXEC command states that value should be a object name, character string Either use another variable to store the results, or change the stored procedure into a function DECLARE @student_id_ticket INT, @table_id INT SELECT @table_id = (select top 1 table_id from systecsys_table where name like ''%Student_List%'') EXEC @student_id_ticket = systecsys_get_next_ticket @table_id, ''n'', 1 or if systecsys_get_next_ticket is a function: DECLARE @student_id_ticket INT SELECT @student_id_ticket = systecsys_get_next_ticket((select top 1 table_id from systecsys_table where name like ''%Student_List%''), ''n'', 1).

Yeah, I don't think you can use a subquery as a parameter to a stored procedure. The spec for the EXEC command states that value should be a object name, character string. Either use another variable to store the results, or change the stored procedure into a function.

DECLARE @student_id_ticket INT, @table_id INT SELECT @table_id = (select top 1 table_id from systecsys_table where name like ''%Student_List%'') EXEC @student_id_ticket = systecsys_get_next_ticket @table_id, ''n'', 1 or if systecsys_get_next_ticket is a function: DECLARE @student_id_ticket INT SELECT @student_id_ticket = systecsys_get_next_ticket((select top 1 table_id from systecsys_table where name like ''%Student_List%''), ''n'', 1).

Used another var to store the value of the subquery in and it worked.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions