M
Mark Neilson
I am having trouble with this code:
ALTER PROCEDURE [dbo].[updateReview] @ID INT, @UserID VARCHAR (13),
@LastAmended DATETIME, @Scope VARCHAR ( 1000 ),
@SignOffDate SMALLDATETIME, @SystemsTaskTableName VARCHAR(100),
@SystemsSubSystemTableName VARCHAR(100), @AircraftID INT,
@IsStartedAnalysis BIT, @IsStartedSystemsAnalysis BIT,
@CloseOffDate SMALLDATETIME, @CloseOffName VARCHAR(100),
@ReviewProjectName VARCHAR(100), @TaskViewName VARCHAR(100),
@SubSystemViewName VARCHAR(100), @SystemsDatabaseName VARCHAR(100)
AS
-- check to see if the last update was more than a single second ago
--IF ABS(DATEDIFF(second, (SELECT LastAmended FROM dbo.Barcodes WHERE ID =
@ID), @LastAmended)) > 1 Return -1
SELECT NULL
UPDATE Reviews
SET
Scope=@Scope,
SignOffDate=@SignOffDate,
SystemsTaskTableName=@SystemsTaskTableName,
SystemsSubSystemTableName = @SystemsSubSystemTableName,
AircraftID = @AircraftID,
IsStartedAnalysis = @IsStartedAnalysis,
IsStartedSystemsAnalysis = @IsStartedSystemsAnalysis,
CloseOffDate = @CloseOffDate,
CloseOffName = @CloseOffName,
ReviewProjectName = @ReviewProjectName,
TaskViewName = @TaskViewName,
SubSystemViewName = @SubSystemViewName,
SystemsDatabaseName = @SystemsDatabaseName
WHERE ID = @ID
/* After the update, return the updated timestamp */
SELECT @LastAmended=GetDate() from Reviews where ID = @ID
-- SELECT NULL required to get value to populated return parameter back to
ADO!
SELECT * from dbo.reviews where id = @id
RETURN 0
Loking at the results in profiler, everything executes according to plan,
hower the return value (parameter in ADO) is only populated if this is
executed prior to the UPDATE statement - -i.e. I can never get 0 to populate
in the return parameter but always get -1 to populate
I am trying the SELECT NULL trick in KB194792 but still no result
ALTER PROCEDURE [dbo].[updateReview] @ID INT, @UserID VARCHAR (13),
@LastAmended DATETIME, @Scope VARCHAR ( 1000 ),
@SignOffDate SMALLDATETIME, @SystemsTaskTableName VARCHAR(100),
@SystemsSubSystemTableName VARCHAR(100), @AircraftID INT,
@IsStartedAnalysis BIT, @IsStartedSystemsAnalysis BIT,
@CloseOffDate SMALLDATETIME, @CloseOffName VARCHAR(100),
@ReviewProjectName VARCHAR(100), @TaskViewName VARCHAR(100),
@SubSystemViewName VARCHAR(100), @SystemsDatabaseName VARCHAR(100)
AS
-- check to see if the last update was more than a single second ago
--IF ABS(DATEDIFF(second, (SELECT LastAmended FROM dbo.Barcodes WHERE ID =
@ID), @LastAmended)) > 1 Return -1
SELECT NULL
UPDATE Reviews
SET
Scope=@Scope,
SignOffDate=@SignOffDate,
SystemsTaskTableName=@SystemsTaskTableName,
SystemsSubSystemTableName = @SystemsSubSystemTableName,
AircraftID = @AircraftID,
IsStartedAnalysis = @IsStartedAnalysis,
IsStartedSystemsAnalysis = @IsStartedSystemsAnalysis,
CloseOffDate = @CloseOffDate,
CloseOffName = @CloseOffName,
ReviewProjectName = @ReviewProjectName,
TaskViewName = @TaskViewName,
SubSystemViewName = @SubSystemViewName,
SystemsDatabaseName = @SystemsDatabaseName
WHERE ID = @ID
/* After the update, return the updated timestamp */
SELECT @LastAmended=GetDate() from Reviews where ID = @ID
-- SELECT NULL required to get value to populated return parameter back to
ADO!
SELECT * from dbo.reviews where id = @id
RETURN 0
Loking at the results in profiler, everything executes according to plan,
hower the return value (parameter in ADO) is only populated if this is
executed prior to the UPDATE statement - -i.e. I can never get 0 to populate
in the return parameter but always get -1 to populate
I am trying the SELECT NULL trick in KB194792 but still no result