delete row query doesn't remove all row when run from access (ms sql)

  • Thread starter Thread starter xavier.goulay
  • Start date Start date
X

xavier.goulay

Hi,

I have a stored procedure which delete rows from a table for a specific
date. When I run the query from Query Analyzer it does work perfectly.
But when I run the query from the corresponding adp project some rows
matching the delete criteria (by date) are still existing. It seems
that adp apply the query only to the visible rows (the ones we can see
in the datagrid). Is there any way to get it applied on the all set of
rows from access?

Thanks
 
This is the procedure run:

ALTER PROCEDURE usp_delete_dataByDate
@dDate AS SMALLDATETIME
AS

DELETE FROM _settings_date WHERE [date] = @dDate

and there is a trigger on _settings_date:

ALTER TRIGGER [Trigger Update _settings_date]
ON _settings_date
FOR DELETE
AS
SET NOCOUNT ON

DECLARE @dDate AS SMALLDATETIME

SELECT @dDate = [date] FROM deleted

DELETE FROM ut_t1 WHERE [data_date] = @dDate
DELETE FROM ut_t2 WHERE [data_date] = @dDate
DELETE FROM ut_t3 WHERE [data_date] = @dDate
DELETE FROM ut_t4 WHERE [data_date] = @dDate

If the proc is run from Query Analyzer it works fine but form access
some entries matching the date criteria still appear.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top