Re: Updating sql05 with Stored Procedure
- From: Chuck P <Chuck@xxxxxxxxxxxxxxxx>
- Date: Thu, 05 Oct 2006 07:46:13 -0600
On Thu, 05 Oct 2006 02:59:37 GMT, v-kevy@xxxxxxxxxxxxxxxxxxxx (Kevin
Yu [MSFT]) wrote:
Hi Chuck,yes
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?
2. If the other rows are not uupdated to the database, what kind ofI just updated 3 rows (added a character to a varchar)
operation have you done with them? Are these rows modified or deleted or
newly added?
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)
.
- Follow-Ups:
- Re: Updating sql05 with Stored Procedure
- From: Kevin Yu [MSFT]
- Re: Updating sql05 with Stored Procedure
- References:
- Updating sql05 with Stored Procedure
- From: Chuck P
- RE: Updating sql05 with Stored Procedure
- From: Kevin Yu [MSFT]
- Updating sql05 with Stored Procedure
- Prev by Date: Re: Any way to force an update after DBConcurrencyException thrown?
- Next by Date: Re: Any way to force an update after DBConcurrencyException thrown?
- Previous by thread: RE: Updating sql05 with Stored Procedure
- Next by thread: Re: Updating sql05 with Stored Procedure
- Index(es):
Relevant Pages
|