1
I’m trying to run a sql server database that returns a variable to me. The Procedure, for example, has the following structure:
CREATE PROCEDURE SP_TESTE
@ID INT,
@REFERENCIA INT OUTPUT
AS
SELECT @REFERENCIA = ID_REFERENCIA
FROM REFERENCIA WHERE ID_REFERENCIA = @ID;
RETURN
GO
In SQL Managementstudio, I use the following query to return my SP OUTPUT:
DECLARE @REF INT
EXEC SP_TESTE 1,@REFERENCIA = @REF OUTPUT
SELECT @REF AS REFERENCIA
Now I would like to know how to pass this query to run in PHP, using the driver for sql server, sqlsrv_query, for example. But in sqlsrv_query I am only able to execute one instruction at a time.
Would that be it? mssql_query('exec SP_TESTE @Externalfieldid', $con);
– Yuri Rodrigues
Sorry, misspelled, need the sqlsrv driver (had posted mssql by mistake)... Apparently it only allows me to do a query execution...
– Guilherme De Col