If Smith's is running in "Test" mode, will the stored procedure be called?
I have written a stored procedure, which executes as desired in the SQL tool but when saved and called from Smith tools, does not seem to fire. I've done a lot of research on the scope identity() function and can get the IDENT_CURRENT('table') function to return the last orderID but for some reason, I can't get the scope_identity() function to return anything. How does it know which table to return the value from - I'm assuming I'm trying to get it to return the value from dbo.Smiths_StoreOrders? I noticed the stored procedure dbo.Smith_AddStoreOrders ends with SELECT scope_identity(), do I use this in some way to retrieve the customerID. Here is my stored procedure as I have it now...any guidance would be greatly appreciated:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Neighbay_ShoppingCart]
AS
DECLARE @OrderID int
DECLARE @UserID int
DECLARE @ExpiryDate datetime
DECLARE @PassDate datetime
SET @ExpiryDate = DATEADD(mm,3,GETDATE())
SET @passdate = CURRENT_TIMESTAMP
SET @OrderID = IDENT_CURRENT('Smith_StoreOrders')
SET @UserID = (SELECT CustomerID FROM Smith_StoreOrders WHERE OrderID = @OrderID)
exec dbo.Ventrian_PropertyAgent_PropertyAdd 495,17,1,@passdate,@passdate,@passdate,@ExpiryDate,0,3,@UserID,1,44.48706,-76.99449