stored procedues with parameters
-
Hello, I have executed a stored procedure written in SQL Server by calling it through VC++. It was done through ODBC APIs SQLConnect(),SQLBindParameter(),SQLExecDirect() etc. Now I want to pass parameters to the procedure I know the syntax that I am suppose to write in VC++. But what changes should I make in the procedure in SQL Server. I have the following stored procedure in SQL in which I want to accept 'LPG' and 'Mumbai' as parameters CREATE PROCEDURE tryproc AS SET @first = 0; ( SELECT SUM(t) AS first FROM demand WHERE product = 'LPG' AND LOCATION = 'Mumbai' ) create table abc (demandsum int); insert into abc (demandsum) values (@first); Is this the right forum to ask this question ?else direct me to the right forum. Thanks Prithaa
-
Hello, I have executed a stored procedure written in SQL Server by calling it through VC++. It was done through ODBC APIs SQLConnect(),SQLBindParameter(),SQLExecDirect() etc. Now I want to pass parameters to the procedure I know the syntax that I am suppose to write in VC++. But what changes should I make in the procedure in SQL Server. I have the following stored procedure in SQL in which I want to accept 'LPG' and 'Mumbai' as parameters CREATE PROCEDURE tryproc AS SET @first = 0; ( SELECT SUM(t) AS first FROM demand WHERE product = 'LPG' AND LOCATION = 'Mumbai' ) create table abc (demandsum int); insert into abc (demandsum) values (@first); Is this the right forum to ask this question ?else direct me to the right forum. Thanks Prithaa
-
Hello, I have executed a stored procedure written in SQL Server by calling it through VC++. It was done through ODBC APIs SQLConnect(),SQLBindParameter(),SQLExecDirect() etc. Now I want to pass parameters to the procedure I know the syntax that I am suppose to write in VC++. But what changes should I make in the procedure in SQL Server. I have the following stored procedure in SQL in which I want to accept 'LPG' and 'Mumbai' as parameters CREATE PROCEDURE tryproc AS SET @first = 0; ( SELECT SUM(t) AS first FROM demand WHERE product = 'LPG' AND LOCATION = 'Mumbai' ) create table abc (demandsum int); insert into abc (demandsum) values (@first); Is this the right forum to ask this question ?else direct me to the right forum. Thanks Prithaa
CREATE PROCEDURE tryproc(@product varchar(10),@LOCATION varchar(50)) AS SET @first = 0; SELECT SUM(t) AS first FROM demand WHERE product = @product AND LOCATION = @LOCATION create table abc (demandsum int); insert into abc (demandsum) values (@first); N.Rajakumar B.E., Application Developer
-
Hello, I have executed a stored procedure written in SQL Server by calling it through VC++. It was done through ODBC APIs SQLConnect(),SQLBindParameter(),SQLExecDirect() etc. Now I want to pass parameters to the procedure I know the syntax that I am suppose to write in VC++. But what changes should I make in the procedure in SQL Server. I have the following stored procedure in SQL in which I want to accept 'LPG' and 'Mumbai' as parameters CREATE PROCEDURE tryproc AS SET @first = 0; ( SELECT SUM(t) AS first FROM demand WHERE product = 'LPG' AND LOCATION = 'Mumbai' ) create table abc (demandsum int); insert into abc (demandsum) values (@first); Is this the right forum to ask this question ?else direct me to the right forum. Thanks Prithaa
prithaa wrote:
Is this the right forum to ask this question ?
Yes it is.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon