Re: Updating sql05 with Stored Procedure






On Thu, 05 Oct 2006 02:59:37 GMT, v-kevy@xxxxxxxxxxxxxxxxxxxx (Kevin
Yu [MSFT]) wrote:

Hi Chuck,

The code you have provided seems to be fine. Since the same code works
alright on the Access DB, I think there might be something wrong with the
stored procedures that you're using to update the database. Please check
the following:

1. Have you provided stored procedures for select/insert/update/delete?
yes

2. If the other rows are not uupdated to the database, what kind of
operation have you done with them? Are these rows modified or deleted or
newly added?
I just updated 3 rows (added a character to a varchar)
3. Could you please post all these stored procedure here?

Here they are. They were all created by the VS dataset wizard with the
exception of the select procedure.

I also tried commenting out the final select statement in the Update
stored procedure, but the results didn't change.


set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [SR].[lutCategories_Del]
(
@Original_CategoryID int,
@Original_RowVersion timestamp
)
AS
SET NOCOUNT OFF;
DELETE FROM [SR].[lutCategories] WHERE (([CategoryID] =
@Original_CategoryID) AND ([RowVersion] = @Original_RowVersion))


====================

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [SR].[lutCategories_Ins]
(
@Description varchar(50),
@IsActive bit
)
AS
SET NOCOUNT OFF;
INSERT INTO [SR].[lutCategories] ([Description], [IsActive]) VALUES
(@Description, @IsActive);

SELECT CategoryID, Description, IsActive, RowVersion FROM
SR.lutCategories WHERE (CategoryID = SCOPE_IDENTITY())

==================================================

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [SR].[lutCategories_Sel]
@GetActiveOnly bit

AS
SET NOCOUNT ON;
SELECT CategoryID, Description, IsActive, RowVersion
FROM SR.lutCategories
WHERE (0=@GetActiveOnly or Sr.lutCategories.IsActive=@GetActiveOnly)
ORDER BY Description

======================================

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [SR].[lutCategories_Upd]
(
@Description varchar(50),
@IsActive bit,
@Original_CategoryID int,
@Original_RowVersion timestamp,
@CategoryID int
)
AS
SET NOCOUNT OFF;
UPDATE [SR].[lutCategories] SET [Description] = @Description,
[IsActive] = @IsActive WHERE (([CategoryID] = @Original_CategoryID)
AND ([RowVersion] = @Original_RowVersion));

SELECT CategoryID, Description, IsActive, RowVersion FROM
SR.lutCategories WHERE (CategoryID = @CategoryID)



.



Relevant Pages


Quantcast