Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. stored procedues with parameters

stored procedues with parameters

Scheduled Pinned Locked Moved Database
databasequestionc++sql-serversysadmin
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prithaa
    wrote on last edited by
    #1

    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

    P R P 3 Replies Last reply
    0
    • P 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

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Read the documentation[^].

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      1 Reply Last reply
      0
      • P 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

        R Offline
        R Offline
        Rajkamal_dfine
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • P 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

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups