I have a problem/question that I may have been staring at too long today.
I have a stored procedure that receives data from an web application. The data comes in as smalldate time format. I am trying to pass this information to a second stored procedure but the second one won't fire unless the data is in single quotes. Would it be better to cast this as varchar?
The SET @CompletedDate must be '2010-01-20 15:28:00" for obvious reasons. How do I pass this information to the second procedure?
DECLARE @return_value int
,@TaskID int
,@CompletedDate smalldatetime
SET @TaskID = 90
SET @CompletedDate = 2010-01-20 15:28:00
EXEC @return_value = [dbo].[usp_Task_Completion]
@TaskID = @TaskID,
@CompletedDate = @CompletedDate
Here is the usp_Task_Completion SP
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[usp_Task_Completion]
@TaskID int
,@CompletedDate smalldatetime
AS
BEGIN
SET NOCOUNT ON;
--Mark Transaction as complete
UPDATE dbo.Task
SET Completed = 1
,CompletedDate = @CompletedDate
WHERE TaskID = @TaskID