Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
CREATE PROCEDURE [spAddNewFaultsRecord]
@userName varchar(150),
@userPhoneNumber varchar(15),
@location varchar(50),
@fault int,
@category smallint,
@operator int,
@sla int,
@newID int = 0 OUTPUT
AS
/*START A NEW TRANSACTION*/
BEGIN trans insertNewField
/*INSERT THE NEW RECORD*/
INSERT INTO Faults (userName,userPhoneNumber,location,fault,category,operator,sla) VALUES (@userName,@userPhoneNumber,@location,@fault,@category,@operator,@sla)
/*GRAB YOUR NEWLY CREATED IDENTITY FIELD*/
SELECT @newID = @@identity FROM inserted
/*COMMIT THE TRANSACTION*/
COMMIT trans insertNewField
dim comObj, userName, userPhoneNumber, location, fault, category, operator, sla, newID
userName = trim(request.form("userName"))
userPhoneNumber = trim(request.form("userPhoneNumber"))
location = trim(request.form("location"))
fault = trim(request.form("fault"))
category = trim(request.form("category"))
operator = trim(request.form("operator"))
sla = trim(request.form("sla"))
'CREATE THE NEW COMMAND OBJECT, WHICH WILL USE YOUR STORED PROCEDURE (SPROC)
set comObj = server.createObject("ADODB.Command")
'ASSIGN THE ACTIVE CONNECTION
comObj.activeConnection = connHelpdesk_STRING
'TELL IT TO USE A SPROC
comObj.commandType = 4 'adCmdStoredProcedure
'TELL IT WHICH SPROC TO USE
comObj.commandText = "spAddNewFaultsRecord"
'ASSIGN YOUR INPUT PARAMETERS
comObj.parameters("@userName").value = userName
comObj.parameters("@userPhoneNumber").value = userPhoneNumber
comObj.parameters("@location").value = location
comObj.parameters("@fault").value = clng(fault)
comObj.parameters("@category").value = clng(category)
comObj.parameters("@operator").value = clng(operator)
comObj.parameters("@sla").value = clng(sla)
'EXECUTE
comObj.execute
'GRAB YOUR OUTPUT PARAMETER
newID = comObj.parameters("@newID").value
INSERTing
Faults
inserted
/*GRAB YOUR NEWLY CREATED IDENTITY FIELD*/
SELECT @newID = @@identity FROM inserted
/*GRAB YOUR NEWLY CREATED IDENTITY FIELD*/
SELECT @newID = @@identity FROM Faults