This is how I write all my database interactions now in Lucee:storedproc     procedure='OrderDetail.WhereOrderHeaderID' {    procparam value=session.Usr.UsrID;    procparam value=url.OrderHeaderID;    procresult resultset=1 name='OrderDetail';    procresult resultset=2 name='OrderHeader';}Assuming I've done this in SQL Server:create schema OrderDetail authorization dboIF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'OrderHeader.[get]') AND type in (N'P', N'PC'))DROP PROC OrderHeader.[get]GOCREATE PROC OrderHeader.[get](@UsrID Int,@OrderHeaderID Int) ASSELECT OrderHeaderInfoFROM OrderHeaderWHERE OrderHeaderID = @OrderHeaderIDIF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'OrderDetail.WhereOrderHeaderID') AND type in (N'P', N'PC'))DROP PROC OrderDetail.WhereOrderHeaderIDGOCREATE PROC OrderDetail.WhereOrderHeaderID(@UsrID Int,@OrderHeaderID Int) ASSELECT Item,QtyFROM OrderDetailWHERE OrderHeaderID = @OrderHeaderIDexec OrderHeader.[get] @UsrID,@OrderHeaderID
Using Stored Procedures in ColdFusion / Lucee
sql;sql server;coldfusion