insertion of parameters

  • how can v insert parameters into procedure

  • April fools?

    Do you really want somebody to answer this, posed this is a question?

    Take a look at the link in my signature, you'll find the right way to ask a question on a forum.

    -- Gianluca Sartori

  • johnhectar (4/1/2010)


    how can v insert parameters into procedure

    ?

  • Assuming this is a serious question...

    Since I'm unclear what you're asking, I'll tell you how to define parameters for your procedure. Assume you want to pass a column called ID to a procedure. You'd do this:

    CREATE PROCEDURE dbo.MyProc

    (@ID int)

    AS...

    The parameter is @ID. It's defined as an integer.

    Is that what you're looking for?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thank you and how can i execute a procedure......

  • johnhectar (4/2/2010)


    Thank you and how can i execute a procedure......

    Well that depends on the context. Depending how you are connecting to the database server, different rules are going to apply. I'll assume you're connecting using SQL Server Management Studio and that you're running this through a query window. To execute a procedure you do this:

    EXEC dbo.MyProc @Param1 = 42, @Param2 = 24

    So, clearly you're calling EXEC to execute the procedure (you can also call EXECUTE). 'dbo' is the schema that owns the proc. MyProc is the name and the other two values are parameters and the values that you're setting them to. That's going to vary between procedures of course.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply