?
Solved

write stored procedure

Posted on 2007-07-23
3
Medium Priority
?
208 Views
Last Modified: 2010-03-20
hello there,

i want to change this query to stored procedure in sql server 2005.how 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+"')";
0
Comment
Question by:zolf
  • 2
3 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 19546189
You're really in the wrong TA - this is Java...
0
 
LVL 75

Expert Comment

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

GO
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 total points
ID: 19546219
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

864 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