write stored procedure

Posted on 2007-07-23
Last Modified: 2010-03-20
hello there,

i want to change this query to stored procedure in sql server will it be.please help.

"INSERT INTO bookht_Port_History (TERMINAL_PORT_ID,CustomerNumber,CustomerName,StartDate,EndDate,Comment) VALUES ('"+terminalPort_id+"','"+ADSLNo+"','"+customerName+"','"+currentDate+"','"+endDate+"','"+comment+"')";
Question by:zolf
    LVL 86

    Expert Comment

    You're really in the wrong TA - this is Java...
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    Create Procedure ins_bookht_Port_History
    @terminalPort_id  int,
    @ADSLNo int,
    @customerName varchar(100),
    @CurrentDate datetime ,
    @endDate datetime,
    @comment varchr(100)
    INSERT INTO bookht_Port_History (TERMINAL_PORT_ID,CustomerNumber,CustomerName,StartDate,EndDate,Comment)
    SELECT @terminalPort_id,@ADSLNo,@customerName,@currentDate,@endDate,@comment

    LVL 75

    Accepted Solution


    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

    Join & Write a Comment

    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 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

    19 Experts available now in Live!

    Get 1:1 Help Now