Stored Proc parameter out question

Posted on 2007-09-28
Last Modified: 2010-03-19
I have a stored proc that I need to get a parameter out (the scope_Identity). When I run my Proc I get an error saying 'expects parameter '@ID', which was not supplied'. Can someone tell me what I am doing wrong in my proc?
@CustomerId int,
@Total money,                  
@ID INT OUTPUT        
Question by:ALawrence007
    LVL 75

    Accepted Solution

    in order to execute it first  declare a variable to hold the outpu

    EXEC {master] 1,2, @Res OUT
    SELECT @Res
    LVL 27

    Expert Comment

    I am confused. I do not understand your data structure.

    You have MyTable, which has two columns. CustomerID is an integer.

    Do you have it set as an identity column? An identity column would automatically add the next available number to the column.

    In your Master procedure, you insert a value that is a parameter - @CustomerID. If the column is an identity column, then why are you inserting a value?

    Then you capture the @ID value by using Scope_Identity(). What value do you want to capture?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now