Link to home
Start Free TrialLog in
Avatar of Zolf
ZolfFlag for United Arab Emirates

asked on

write stored procedure

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+"')";
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You're really in the wrong TA - this is Java...
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
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial