Showing posts with label deletes. Show all posts
Showing posts with label deletes. Show all posts

Tuesday, March 27, 2012

Deleting more duplicates

Hello,
I have a stored procedure that deletes duplicates
in one table:

....
AS
BEGIN
DELETE FROM mytable
WHERE Id IN(
SELECT Max(id)
from mytable
group by date, idsens
having count(*) >1
)
END

sometimes it happens that I have >2 rows with duplicated values.
How can I write a new stored procedure that delete all rows with
duplicated infomrations (leaving only one row with those values)?

Thanks
M.A.On Tue, 25 Jul 2006 10:36:10 GMT, Maury wrote:

Quote:

Originally Posted by

>Hello,
>I have a stored procedure that deletes duplicates
>in one table:
>
>...
>AS
>BEGIN
>DELETE FROM mytable
>WHERE Id IN(
>SELECT Max(id)
>from mytable
>group by date, idsens
>having count(*) >1
>)
>END
>
>sometimes it happens that I have >2 rows with duplicated values.
>How can I write a new stored procedure that delete all rows with
>duplicated infomrations (leaving only one row with those values)?


Hi Maury,

For SQL Server 2005:

WITH DeDupe (Id, rn)
AS (SELECT Id, ROW_NUMBER() OVER (PARTITION BY date, idsens ORDER BY Id)
FROM mytable)
DELETE DeDupe
WHERE rn 1;

For all versions of SQL Server:

DELETE FROM mytable
WHERE EXISTS
(SELECT *
FROM mytable AS m2
WHERE m2.date = mytable.date
AND m2.idsens = mytable.idsens
AND m2.Id < mytable.Id);

--
Hugo Kornelis, SQL Server MVP|||Hugo Kornelis ha scritto:

Quote:

Originally Posted by

WITH DeDupe (Id, rn)
AS (SELECT Id, ROW_NUMBER() OVER (PARTITION BY date, idsens ORDER BY Id)
FROM mytable)
DELETE DeDupe
WHERE rn 1;


This is very very interesting (I didn't know these commands)
I have to search a good reference
or stored procedure language manual
for sql server 2005
some hints?
thanks!!!!
M.A.|||Maury (maurizio.alberti_TOGLI_@.gmail.com) writes:

Quote:

Originally Posted by

This is very very interesting (I didn't know these commands)
I have to search a good reference
or stored procedure language manual
for sql server 2005
some hints?


Books Online. Ships with SQL Server. Update available from the link below.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Sunday, March 25, 2012

Deleting from a list.

Hi;

I am still improving my sql/tsql skills.

I was wondering if someone could give me some advice on how to do some
high powered deletes.

I have two tables, A and B.

"A" is the table I want to delete records from.

"B" is a table where each record is 4 keys ( fields ) that I want to
match with one or more records in "A" to remove.

Could I accomplish this with something like

delete from A ( select ... from B ) ?

SteveHi

Books online should be the first option when wanting to find out information
regarding syntax etc. and example D on the delete definition page gives you
exactly what you want.

http://msdn.microsoft.com/library/d...asp?frame=true

John

"Steve" <stevesusenet@.yahoo.com> wrote in message
news:6f8cb8c9.0310311713.1be6dc2e@.posting.google.c om...
> Hi;
> I am still improving my sql/tsql skills.
> I was wondering if someone could give me some advice on how to do some
> high powered deletes.
> I have two tables, A and B.
> "A" is the table I want to delete records from.
> "B" is a table where each record is 4 keys ( fields ) that I want to
> match with one or more records in "A" to remove.
> Could I accomplish this with something like
>
> delete from A ( select ... from B ) ?
> Steve

Deleting from 2 tables?

Hi, I am pretty new to SQL and know that I am probably going around this the wrong way.

I want to make a stored proc that deletes rows from table 1 and delete rows from table 2 where the common link is the id.

Any help would be greatly appreciated!

Many thanks

moopIf you have a relationship set between the tables, you can set the action in table 1 to "On Delete Cascade".
|||*blush*

Thanks for the reply. I just realised that unlike mySql you can issue two deletes in one stored proc like so

DELETE FROM tblSupplierType WHERE supplierType_id = @.supplierType_id;
DELETE FROM tblSuppliers WHERE supplierType_id = @.supplierType_id

MAny thanks for the reply|||I would probably still use the On Delete Cascade option, because ifsomeone comes along and changes your SQL statement later, you'll have alot of stranded Supplier records. With On Delete Cascade, it allhappens as part of the original delete.
Either way I would suggest wrapping those two statements in atransaction, and you'll need to reverse the order in which you've shownthem.
|||

I'm trying this using the Club Starter Kit, creating a relationship between the Albums and Images table, where the PK Album ID in the Albums table has a relationship to the Images table via the album field.

When I create the relationship and use the OnDeleteCascase option, I'm receiving this error:

'Albums' table saved successfully
'images' table
- Unable to create relationship 'FK_images_Albums'.
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_images_Albums". The conflict occurred in database "C:\DOCUMENTS AND SETTINGS\GARY\MY DOCUMENTS\VISUAL STUDIO 2005\WEBSITES\MyWebSite\MyWebSite.MDF", table "dbo.Albums", column 'albumid'.

any thoughts on what might be wrong?

I know the PK ablumid is an identity field. Does that matter?

Thanks,

Gary

|||

Disregard my previous post. I was able to get the Cascade to work with Delete.

Thanks,

Gary

Wednesday, March 21, 2012

Deleting and Updating from Gridview

Hi,

I made a gridview, and I am trying to make it so when the user deletes a row, values in other tables update. I used the following source code:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Transactions] WHERE [TransactionID] = @.TransactionIDAND UPDATE [items] SET Quantityavailable, numtaken VALUES Quantityavailable + 1, numtaken - 1 WHERE ([Itemid] = @.Itemid) "

It gives the error that Quantityavailable is not a SET type?

Thanks if you can suggest a remedy!

Jon

jbear123:

UPDATE [items] SET Quantityavailable, numtaken VALUES Quantityavailable + 1, numtaken - 1 WHERE ([Itemid] = @.Itemid

That is not valid syntax for an UPDATE statement.

Try this

UPDATE itemsSET Quantityavailable = Quantityavailable + 1, numtaken = numtaken - 1WHERE ItemId = @.ItemId
|||

Thanks!

Monday, March 19, 2012

Deleting a datbase.

Can anyone help me with this ?
I was wondering if there is a command I can run that deletes a database? I know this can be done in Enterprise Manager.
Have tried a few sites and searches to no avail...
Any help appreciated...
Maith agat,It's as easy as DROP DATABASE.

PS It's in the books online;)

Sunday, March 11, 2012

Deletes/Inserts in Merge replication

Hi,
I am using mergereplication for doing .1 miliion records /day. I find the
replication is getting stuck because of a few deletes/updates.
Is there a better way to handle this?
Ravi,
when you mention that it is getting stuck, what exactly is the error
message - please can you post it up.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Deletes through Replication

I have an order header we'll call HEADER and detail we'll call DETAIL
(catchy names !!)
When I replicate new orders, I use filters:
The HEADER article filter is like:
Select * from HEADER
where ordr_dte >= '1998-01-01'
then
The DETAIL filter is like:
Select * from DETAIL
where exists (SELECT * FROM HEADER WHERE DETAIL.ord_num = HEADER.ord_num
and (HEADER.ordr_dte >= '1998-01-01' ))
This makes sure I only get DETAILS that match filtered HEADERS.
Everything's fine so far. Subscriber matches Publisher
Now, our order processing application sometimes deletes order records. Not
very often, but if a transaction is backed out before being posted or
something.
Anyway, the problem is that on the Publisher, the application deletes the
HEADER record, which gets deleted on the Subscriber .... FINE
Then the DETAIL gets deleted on the Publisher .... BUT ... since my
filter only deals with DETAILS that have an associated HEADER, and the HEADER
doesn't exist any more, I'm left with an orphan DETAIL record on the
subscriber.
What should I do ? Is there a better way to set this up to start with ?
if you are using merge replication have a look at join filters.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"HomeBrew" <HomeBrew@.discussions.microsoft.com> wrote in message
news:29A8C1EA-42EC-40DE-873F-5F01C2FEBAFE@.microsoft.com...
> I have an order header we'll call HEADER and detail we'll call DETAIL
> (catchy names !!)
> When I replicate new orders, I use filters:
> The HEADER article filter is like:
> Select * from HEADER
> where ordr_dte >= '1998-01-01'
> then
> The DETAIL filter is like:
> Select * from DETAIL
> where exists (SELECT * FROM HEADER WHERE DETAIL.ord_num =
HEADER.ord_num
> and (HEADER.ordr_dte >= '1998-01-01' ))
> This makes sure I only get DETAILS that match filtered HEADERS.
> Everything's fine so far. Subscriber matches Publisher
> Now, our order processing application sometimes deletes order records. Not
> very often, but if a transaction is backed out before being posted or
> something.
> Anyway, the problem is that on the Publisher, the application deletes the
> HEADER record, which gets deleted on the Subscriber .... FINE
> Then the DETAIL gets deleted on the Publisher .... BUT ... since my
> filter only deals with DETAILS that have an associated HEADER, and the
HEADER
> doesn't exist any more, I'm left with an orphan DETAIL record on the
> subscriber.
> What should I do ? Is there a better way to set this up to start with ?
|||I'm just using regular Transactional Replication.
Is there some better filter logic I can use to avoid orphans ?
"Hilary Cotter" wrote:

> if you are using merge replication have a look at join filters.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> "HomeBrew" <HomeBrew@.discussions.microsoft.com> wrote in message
> news:29A8C1EA-42EC-40DE-873F-5F01C2FEBAFE@.microsoft.com...
> HEADER.ord_num
> HEADER
>
>
|||Yes, but could you post your schema for both tables?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"HomeBrew" <HomeBrew@.discussions.microsoft.com> wrote in message
news:582163AF-EEC9-4633-B723-70D2B72C9E1A@.microsoft.com...[vbcol=seagreen]
> I'm just using regular Transactional Replication.
> Is there some better filter logic I can use to avoid orphans ?
> "Hilary Cotter" wrote:
Not[vbcol=seagreen]
the[vbcol=seagreen]
my[vbcol=seagreen]
with ?[vbcol=seagreen]
|||Here are the schemas for the "HEADER" and "DETAIL" tables. (1 Header to
Many Details)
Below them are the snippets from my Replication Row Filters. These tables
are part of a package, so I can't make the Detail get deleted before the
Header.
Schema for PROORD_M ("HEADER" Table, I removed many irrelevant fields in
the interest of space)
CREATE TABLE [dbo].[PROORD_M] (
[ORD_NUM] [char] (8) NOT NULL ,
[CTG_DTE] [datetime] NOT NULL ,
[ORD_CTG] [char] (6) NOT NULL ,
[NUM_OPS] [char] (8) NOT NULL ,
[CTM_NBR] [char] (12) NOT NULL ,
[CTG_DTE2] [decimal](8, 0) NOT NULL ,
[ORD_CTG2] [char] (6) NOT NULL ,
[ORD_STA] [char] (1) NOT NULL ,
[ORD_NUM2] [char] (8) NOT NULL ,
[PO_NUM] [char] (20) NULL ,
[ORDR_DTE] [datetime] NULL ,
[SHP_DTE] [datetime] NULL ,
[ORD_TYPE] [char] (1) NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PROORD_M] ADD
CONSTRAINT [PROORD_M_K1] PRIMARY KEY CLUSTERED
([ORD_NUM]) WITH FILLFACTOR = 90 ON [PRIMARY] ,
CONSTRAINT [PROORD_M_K2] UNIQUE NONCLUSTERED
([CTG_DTE],
[ORD_CTG],
[NUM_OPS]) WITH FILLFACTOR = 90 ON [PRIMARY] ,
CONSTRAINT [PROORD_M_K4] UNIQUE NONCLUSTERED
([ORD_STA],
[ORD_NUM2]) WITH FILLFACTOR = 90 ON [PRIMARY]
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++
Schema for PROOLN_M ("DETAIL" Table, I removed many irrelevant fields in
the interest of space)
CREATE TABLE [dbo].[PROOLN_M] (
[ORD_NUM] [char] (8) NOT NULL ,
[ORD_SPSQ] [char] (6) NOT NULL ,
[ORD_SEQ] [char] (5) NOT NULL ,
[SHP_CTM] [char] (12) NOT NULL ,
[ITM_NUM2] [char] (10) NOT NULL ,
[ITM_NUM3] [char] (10) NOT NULL ,
[ORD_NUM3] [char] (8) NOT NULL ,
[OLN_STA] [char] (2) NULL ,
[ITM_NUM] [char] (10) NULL
[QTY_ORD] [int] NULL ,
[QTY_SHP] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PROOLN_M] ADD
CONSTRAINT [PROOLN_M_K1] PRIMARY KEY CLUSTERED
([ORD_NUM],
[ORD_SPSQ],
[ORD_SEQ]) WITH FILLFACTOR = 90 ON [PRIMARY]
++++++++++++++++++++++++++++
Row filter for PROORD ("HEADER" Table)
SELECT <published_columns> FROM <<PROORD_M>>
WHERE ordr_dte >= '1998-01-01' or ordr_dte is null
++++++++++++++++++++++++++++
Row filter for PROOLN ("DETAIL" Table)
SELECT <published_columns> FROM <<PROOLN_M>>
WHERE exists
(SELECT * FROM AdvDbPrd.dbo.proord_m WHERE
prooln_m.ord_num = proord_m.ord_num
and (ordr_dte >= '1998-01-01' or ordr_dte is null))

Deletes on subscriber in merge replication

Using Merge replication between SQL Server 2000 and SQL Server CE,
is there any way that row deletes could occur on the subscriber without a reinitialize
or explicit delete of row on publisher.

More specifically, if there is a row filter that returns a days worth of data with each
days pull, for example, and the filter looked like
select <columns> from Table where UpdateDate < GETDATE() and UpdateDate >= DATEADD(d,1,GETDATE())
would there be some implicit delete at subscriber each day because data sent changed?

My research indicates this does not happen, but I have a colleague who thinks differently.

Merge replication is trigger-based, meaning a change has to happen for the filter to be evaluated. So basically your filter will not guarantee your subscriber to have rows that meet your filter criteria without some process that does some sort of dummy update to the rows for it to be processed.

However please look at this best practice topic "Best Practices for Time-Based Row Filters": http://msdn2.microsoft.com/en-us/library/ms365153.aspx, it shows how you can accomplish what you want.

|||

Thanks for the clarification. I have been able to convince myself that deletes occur on the subscriber for records outside the filter if I apply some update. I am trying to help a customer with replication performance issues. The application does a reinitialize on every request from the user for synchronization. This is sending 10000 or more rows. When I asked them why they do a reinit every time, they were not sure (the original programmer is gone), but they said there was a problem with deletes taking so long and it was better to just reinit. That is why I asked the original question. I did not know what deletes they could be talking about.

I am curious about the deleted records. It seems that the server must be sending over deletes for every updated record outside the filter. In my case, the filter is not only time based but uses HOST_NAME(). There are about 1000 handhelds out there. So if I used the method of the best-practices article, it would seem that with each synch I would be sending over deletes for all 1000 users each time.

Maybe that was what the original programmer did and what was taking too much time (even though there would be no actual delete, because those other records were never there).

Is this the behavior that would occur?

Thanks again

Ed Santosusso

|||

In SQL 2000, yes deletes are much slower compared to inserts and updates, but this has been improved in SQL 2005 provide you use the new pre-computed partitions.

|||

Moving data in and out of a partition can send over deletes, it's the only way to remove the data from the subscriber. And in SQL 2000, yes deletes are much slower compared to inserts and updates, but this has been improved in SQL 2005 provide you use the new pre-computed partitions.

Deletes occurring at publisher

I'm using Merge replication on a table with an autoidentity field. All
users are entering data at the publisher (no records are ever deleted),
and at the subscribers the data is read-only. I'm having a problem
with records being deleted at the publisher. I'm assuming it has to do
with a subscriber having problems, but I can't track it down.
Moving forward (SQL 2005), I want to change the replication type to
transactional. Could someone please tell me the best type of
replication to use in order to prevent records from being deleted at
the publisher?
Any help would be greatly appreciated.
Thanks,
Amy Marshall
Does anything show up in the conflict viewer? The deletes could be logged
here. Are you using join filters? These can cause these types of deletes,
but normally not on the publisher.
Transactional replication is designed for one way replication. It is not
clear to me what your data flow requirements are. With transactional
replication users will be able to delete data in any location, but only
deletes occurring on the publisher will be replicated to the subscriber.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<marshallae@.bowater.com> wrote in message
news:1138635297.513324.39100@.g47g2000cwa.googlegro ups.com...
> I'm using Merge replication on a table with an autoidentity field. All
> users are entering data at the publisher (no records are ever deleted),
> and at the subscribers the data is read-only. I'm having a problem
> with records being deleted at the publisher. I'm assuming it has to do
> with a subscriber having problems, but I can't track it down.
> Moving forward (SQL 2005), I want to change the replication type to
> transactional. Could someone please tell me the best type of
> replication to use in order to prevent records from being deleted at
> the publisher?
> Any help would be greatly appreciated.
> Thanks,
> Amy Marshall
>
|||Amy,
the issue might be caused by compensating changes. Please take a look at :
http://support.microsoft.com/default...&Product=sql2k
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||This morning I had 264 conflicts, which I kept to make sure I got the
deleted records back into the table, but this was the first time there
were any conflicts at all for that table. We are not using any join
filters on this table. I was thinking of using transactional
replication, because all entries into the problem table are done at the
publisher, and the inputs into that table are synched to the
subscribers based on a timeframe that is set from an application which
determines sync times. (Most users set synch times anywhere from 60
minutes - 240 minutes).
What's weird, is that there is a table that is in the same merge
package, that links to an ID in the problem table, but those records
are NEVER deleted at the publisher (no foreign key constraint exists
between the 2 tables). This one table seems to have the problem, and
while monitoring replication, I rarely ever see problems with
subscribers and this package.
Thanks for your input.
Amy

Deletes in the subscriber

Hi,
I'm having a problem with replication.
The situation is the following:
Operating System of the server: Win server 2003
Database: SQL 2000
Subscribers: SQLCE in PDA's HP5550
Number of subscribers: 23
Subscription: Daily
Somme of the subscribers (PDA) take some a long time to process all the information from the replications. This process of replication take 30 to 45 minutes. In the replication monitor i see that it sends something like 230 000 deletes. It′s a lot for a
PDA processing.
What can i do to improve this situation.
Thatk's for your atention
Best Regards
PPereira
Hi PPereira,
You might be interested in the following document:
Diagnosing and Troubleshooting Slow Partitioned Merge Processes
http://msdn.microsoft.com/library/de...artitioned.asp
Hope this helps,
Reinout Hillmann
SQL Server Product Unit
This posting is provided "AS IS" with no warranties, and confers no rights.
PPereira wrote:
> Hi,
> I'm having a problem with replication.
> The situation is the following:
> Operating System of the server: Win server 2003
> Database: SQL 2000
> Subscribers: SQLCE in PDA's HP5550
> Number of subscribers: 23
> Subscription: Daily
> Somme of the subscribers (PDA) take some a long time to process all the information from the replications. This process of replication take 30 to 45 minutes. In the replication monitor i see that it sends something like 230 000 deletes. It′s a lot for
a PDA processing.
> What can i do to improve this situation.
> Thatk's for your atention
> Best Regards
> PPereira

Deletes in an updategram

I think this a bit of a long shot as it doesn't seem (according to the
documentation and just trying it out) possible but I thought I'd double
check. I've got an update happening which also includes rows on a
different table which might have been removed during the transaction
I'd therefore like to delete the rows or remove them from the
relationship (though deleting would be better).
I have something like:
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<updg:sync xmlns:updg="urn:schemas-microsoft-com:xml-updategram"
mapping-schema="schema/person.xsd">
<updg:before>
<y0:Person xmlns:y0="pretend:URN"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sql="urn:schemas-microsoft-com:xml-sql"
id="65654D01-35A9-4901-91DB-5618037ACE2C">
<y0:Address id="EC3831B2-83C4-46FB-A44F-57668E7ADD47"/>
<y0:Identifiers>
<y0:Identifier personID="65654D01-35A9-4901-91DB-5618037ACE2C"
id="5BD49D1F-7521-4247-9251-C195D4BEC079"/>
<y0:Identifier personID="65654D01-35A9-4901-91DB-5618037ACE2C"
id="FFC04502-1D16-4A2A-8939-F02ACFEE134E"/>
<y0:Identifier personID="65654D01-35A9-4901-91DB-5618037ACE2C"
id="868B29EF-B749-4903-B34B-FE39E4FE3D5D"/>
</y0:Identifiers>
</y0:Person>
</updg:before>
<updg:after>
<y0:Person xmlns:y0="pretend:URN"
id="65654D01-35A9-4901-91DB-5618037ACE2C">
<y0:DateOfBirth>2001-03-12</y0:DateOfBirth>
<y0:Sex>Male</y0:Sex>
<y0:Address id="EC3831B2-83C4-46FB-A44F-57668E7ADD47">
</y0:Address>
<y0:Identifiers>
<y0:Identifier id="5BD49D1F-7521-4247-9251-C195D4BEC079"
personID="65654D01-35A9-4901-91DB-5618037ACE2C">
<y0:Value>1203120135</y0:Value>
<y0:Type>Bleh</y0:Type>
</y0:Identifier>
<y0:Identifier id="FFC04502-1D16-4A2A-8939-F02ACFEE134E"
personID="65654D01-35A9-4901-91DB-5618037ACE2C">
<y0:Value>123456A</y0:Value>
<y0:Type>Foo</y0:Type>
</y0:Identifier>
</y0:Identifiers>
</y0:Patient>
</updg:after>
</updg:sync>
</ROOT>
Now what I was hoping was the three identifiers at the top would result
in the deleted identifier being removed from the database. However
instead I get a "All updategram/diffgrams nodes with siblings must have
ids, either user specified ones or mapping schema based key field id"
which I assume is as a result of an ambiguous delete operation.
It would be of great help if someone either shot this down as something
you can't do though better if there is a way to do it without trying to
work out everything that has changed and do multiple sync operations.
Thanks,
Gary
Never mind!
I was being silly. I forgot to upload one of the changed schema that
had the key-fields defined and that was what was causing the problems.
After fixing that everything worked just fine.
Thanks anyway,
Gary

Deletes in an updategram

I think this a bit of a long shot as it doesn't seem (according to the
documentation and just trying it out) possible but I thought I'd double
check. I've got an update happening which also includes rows on a
different table which might have been removed during the transaction
I'd therefore like to delete the rows or remove them from the
relationship (though deleting would be better).
I have something like:
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<updg:sync xmlns:updg="urn:schemas-microsoft-com:xml-updategram"
mapping-schema="schema/person.xsd">
<updg:before>
<y0:Person xmlns:y0="pretend:URN"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sql="urn:schemas-microsoft-com:xml-sql"
id="65654D01-35A9-4901-91DB-5618037ACE2C">
<y0:Address id="EC3831B2-83C4-46FB-A44F-57668E7ADD47"/>
<y0:Identifiers>
<y0:Identifier personID="65654D01-35A9-4901-91DB-5618037ACE2C"
id="5BD49D1F-7521-4247-9251-C195D4BEC079"/>
<y0:Identifier personID="65654D01-35A9-4901-91DB-5618037ACE2C"
id="FFC04502-1D16-4A2A-8939-F02ACFEE134E"/>
<y0:Identifier personID="65654D01-35A9-4901-91DB-5618037ACE2C"
id="868B29EF-B749-4903-B34B-FE39E4FE3D5D"/>
</y0:Identifiers>
</y0:Person>
</updg:before>
<updg:after>
<y0:Person xmlns:y0="pretend:URN"
id="65654D01-35A9-4901-91DB-5618037ACE2C">
<y0:DateOfBirth>2001-03-12</y0:DateOfBirth>
<y0:Sex>Male</y0:Sex>
<y0:Address id="EC3831B2-83C4-46FB-A44F-57668E7ADD47">
</y0:Address>
<y0:Identifiers>
<y0:Identifier id="5BD49D1F-7521-4247-9251-C195D4BEC079"
personID="65654D01-35A9-4901-91DB-5618037ACE2C">
<y0:Value>1203120135</y0:Value>
<y0:Type>Bleh</y0:Type>
</y0:Identifier>
<y0:Identifier id="FFC04502-1D16-4A2A-8939-F02ACFEE134E"
personID="65654D01-35A9-4901-91DB-5618037ACE2C">
<y0:Value>123456A</y0:Value>
<y0:Type>Foo</y0:Type>
</y0:Identifier>
</y0:Identifiers>
</y0:Patient>
</updg:after>
</updg:sync>
</ROOT>
Now what I was hoping was the three identifiers at the top would result
in the deleted identifier being removed from the database. However
instead I get a "All updategram/diffgrams nodes with siblings must have
ids, either user specified ones or mapping schema based key field id"
which I assume is as a result of an ambiguous delete operation.
It would be of great help if someone either shot this down as something
you can't do though better if there is a way to do it without trying to
work out everything that has changed and do multiple sync operations.
Thanks,
GaryNever mind!
I was being silly. I forgot to upload one of the changed schema that
had the key-fields defined and that was what was causing the problems.
After fixing that everything worked just fine.
Thanks anyway,
Gary

Deletes From Multiple Tables.

Hello everybody,

We have a Master table in the Db who's PK is referenced in at least 60 tables as FK.
We want to delete all the dependent records in 1 go without using multiple delete statements or any cursor or loop.

Is it possible? Please advice.

Thanks in advance.

Regards,

Ashishuse "Cascade Delete"...|||I'm sorry i forgot to mention that the Cascading Deletes are not allowed.

Even wrtting a trigger to delete from all the tables will mean writing some kind of loop or Cursor if we use the system tables.
I can use sys tables but the delete qury using sys tbales needs to execute in 1 go. No cursors or temp tables should be used.

Is there any other way?|||I'm sorry i forgot to mention that the Cascading Deletes are not allowed.
Frickin' morons.
My advice is to go work for a company that isn't managed by idiots.|||Now there's the blind dude we all know and love|||No cascading deletes allowed.
No temp tables allowed.
No cursors allowed. (Well, at least they are on the right track with that one...)

Absolute amateurs.

What advice would you give them?|||What advice would you give them?

Well, it realy sounds like a request for homework...but

DECLARE @.FKey sysname, @.keyvalue varchar(8000), @.sql varchar(8000)
SELECT @.FKey = 'EmployeeID', @.keyValue = '1', @.sql = ''

SELECT @.sql = @.sql + 'DELETE FROM ['+o.name+'] WHERE '+@.FKey+'='+@.KeyValue+' GO '
FROM sysreferences r
LEFT JOIN sysobjects o
ON r.fkeyid = o.id
WHERE rkeyid = OBJECT_ID('Employees')

SELECT @.sql

--EXEC(@.sql)|||Thanks dear friends.

Brett, it's not a homework at all.

In fact, i'm working on the one of the largest .Net implementations in the world. But somehow we have some basic guidelines which do not allow certain things.

Me being the modest developer cannot argue with the people who have set these guidelines. Please forgive those poor souls for their ignorance.

Thanks once again. :)|||In fact, i'm working on the one of the largest .Net implementations in the world. But somehow we have some basic guidelines which do not allow certain things
Using cascading deletes is the best solution for this problem (and is supported by all major DBMS).
If the "world largest" project does not apply the most effectice solutions to such a basic problem, then I'm pretty sure it is going to fail. This is extremely short-sighted and will create more maintenance trouble then they probably are willing to pay for. Why not use flat files, if they don't want to use the features of a database?
(nothing personal against you wash, it's just that I see this kind of stupid decisions all around...)|||Man, i don't mind it as long as they are paying me for the job. [:D]

I do not exactly know what has prompted the TAs to avoid cascade deletes.|||In fact, i'm working on the one of the largest .Net implementations in the world. But somehow we have some basic guidelines which do not allow certain things.

reading this made think he was working for the US federal government. in which case it may very well fail. The FBI can not get their case management software together, the IRS has been struggling for years to modernize.|||reading this made think he was working for the US federal government. in which case it may very well fail. The FBI can not get their case management software together, the IRS has been struggling for years to modernize.

Forgive me but i don't work on any such project.|||I have had everyone in my team at my company, including the so called SQL experts working with me, brainstorm on this issue.

It seems without a recursive loop , we cannot achieve this.

Can you give me any idea if we can achieve this using a simple loop.

I want to delete all the dependent records to the Nth level.

Thanks in advance.|||HAve one of your "sql experts" get in on this thread...and did you even look at my code?|||What in the world would drive such requirements? It makes as much sense as "We'd like to retrieve all the data from the database but I can't reference any table names or use the word 'select'".

I'm also guessing that you're going to generate a heap of log activity with this puppy, so you might want to think about doing a set of tables at a time or a set of primary key values, unless you own unlimited disk.|||Thanks Brett. i did use your code but it useful only for the first level of dependencies.

Thankfully people have realized what kind of issues have cropped up due to such requirement and thankfully we are working on some realistic solution.

I would like to thank everyone for chipping in with helpful suggestions and valuable advice.

thanks once again.

Deletes

I want to clarify something regarding the deletes. On Publisher, we have a
table which has foreign keys. I checked the same table in subscriber. It
does not have foreign keys but it has primary and unique keys. Does
Replication ensure that delete happen in the same order on all subscribers as
they do in Publisher otherwise we can end up with orphans in subscribers.
For deletes, we are replicating the execution of delete stored procedure.
Can someone please clarify this?
Thanks
For transaction, yes it does as long as cascading updates and deletes are
enforced for replication.
With merge it is best to make the constraints not for replication.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Sal" <Sal@.discussions.microsoft.com> wrote in message
news:F2C6E011-F9BF-4DC6-9346-71563E93E25D@.microsoft.com...
>I want to clarify something regarding the deletes. On Publisher, we have a
> table which has foreign keys. I checked the same table in subscriber. It
> does not have foreign keys but it has primary and unique keys. Does
> Replication ensure that delete happen in the same order on all subscribers
> as
> they do in Publisher otherwise we can end up with orphans in subscribers.
> For deletes, we are replicating the execution of delete stored procedure.
> Can someone please clarify this?
>
> Thanks
>

Deletes

In a heavly indexed table, why does a delete step run forever?
JimBecuase it has to change the data pages and the indexes...

INSERTS should take even longer...

What does the DELETE statement look like?

And what about the DDL for the table...|||Originally posted by Brett Kaiser
Becuase it has to change the data pages and the indexes...

INSERTS should take even longer...

What does the DELETE statement look like?

And what about the DDL for the table...
Thats what i was thinking

the statment is basiacaly
delete tablename
where date = '2003/12/12'
and direction = 'E'

simple enought but there are about 12 indexes on the table. There is also 20 some od columns to the table so its got a bit to go through. Sounds like a delete step isnt the right thing to do...but I dont know of anything else. Rebuilding the table has proven to be faster though, guess im gona go back to that.
Jim|||apparently you have a long table with quite a few records meeting the criteria, because even if there are 12 indexes it should go through delete farely fast if the number of rows affected it significantly less than the total number of rows (<500)|||Originally posted by ms_sql_dba
apparently you have a long table with quite a few records meeting the criteria, because even if there are 12 indexes it should go through delete farely fast if the number of rows affected it significantly less than the total number of rows (<500)
we are trying to delete about 500000 rows out of a 23Million row table
hehe
Jim|||Do any of your indexes have date and/or direction?|||Originally posted by Brett Kaiser
Do any of your indexes have date and/or direction?

Direction yes, no date indexes...coleage of mine was thinking that it would be benificial if we had a date index....
Jim|||Well hell yes...

Do a show estimated execution plan, and tell us what you get...

I'm thinking table scan...

Edit is direction part of a composite of another index, or is it all by it's lonesome?

If it's alone, just add date to that one, and go have a couple of beers...it'll take a while....

better to schedule a script to run overnight...

let us know how long it takes if you do do it...|||An informative an lengthy discourse on indexes

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=30090&SearchTerms=index,intersection|||you'd really benefit having date and direction as an index (order depends on selectivity of direction vs. date, the less selective field should be first).|||Make sure you have a clustered index on the table as well as heaps reclaim empty space and deletes on fragmented tables take longer than normal.

dbcc showcontig on the table will tell you how fragemented the table is.

HTH

Saturday, February 25, 2012

delete trigger for multiple row deletes

I'm racking my brain trying to figure this one out and I have a feeling it's
simpler than I'm making it out to be. I need a trigger that will prevent
delete of certain rows but not all. For example, I have a customer table:
CustID INT (primary key, auto inc)
CustName VARCHAR(50)
and an orders table:
OrderID INT (primary key, auto inc)
CustID INT (FK to other table of course)
ItemOrdered VARCHAR(100)
Here would be the data:
Customer table:
CustID CustName
1 Jones Lumber
2 Smith's Cars
3 Helen's Carpet
Orders table:
OrderID CustID ItemOrdered
1 1 2x4's
2 1 Dowel
3 3 Berber
4 3 Shag
Notice that Smith's Cars is not in the orders table at all.
Now I select all the rows in the customer table and try to delete them. I'd
like the trigger to prevent the delete of any customer that has orders but
allow the others to be deleted. So in this case Jones Lumber and Helen's
Carpet would remain and Smith's Cars would be deleted.
The trouble I'm having is that if I set up a cursor in the trigger to
sequence through the customers, how do I rollback just some of the deletes
but not all and put up an appropriate message?
DECLARE
@.iCustID AS INT,
@.sMsg AS VARCHAR(500)
SET NOCOUNT ON
SET @.sMsg = ''
DECLARE curCustomers CURSOR FOR SELECT C.CustID FROM DELETED C
OPEN curCustomers
FETCH NEXT FROM curCustomers INTO @.iCustID
IF @.@.FETCH_STATUS = 0
BEGIN
WHILE @.@.FETCH_STATUS = 0
BEGIN
IF (SELECT COUNT(*) FROM tblOrders WHERE CustID = @.iCustID) > 0
BEGIN
ROLLBACK TRANSACTION
SET @.sMsg = 'Customers with orders cannot be deleted.'
END
FETCH NEXT FROM curCustomers INTO @.iCustID
END
END
IF @.sMsg <> ''
RAISERROR (@.sMsg, 16, 1)
CLOSE curCustomers
DEALLOCATE curCustomers
===
My original trigger looked like this until I realized it was rolling back
the whole thing without even attempting to test for rows that should be
allowed to be deleted:
IF (SELECT COUNT(*) FROM tblOrders WHERE CustID IN (SELECT CustID FROM
DELETED)) > 0
BEGIN
ROLLBACK TRANSACTION
RAISERROR ('Customers with orders cannot be deleted.', 16, 1)
END
Thanks,
KeithKeith G Hicks wrote:
> I'm racking my brain trying to figure this one out and I have a feeling it
's
> simpler than I'm making it out to be. I need a trigger that will prevent
> delete of certain rows but not all. For example, I have a customer table:
> CustID INT (primary key, auto inc)
> CustName VARCHAR(50)
> and an orders table:
> OrderID INT (primary key, auto inc)
> CustID INT (FK to other table of course)
> ItemOrdered VARCHAR(100)
> Here would be the data:
> Customer table:
> CustID CustName
> 1 Jones Lumber
> 2 Smith's Cars
> 3 Helen's Carpet
> Orders table:
> OrderID CustID ItemOrdered
> 1 1 2x4's
> 2 1 Dowel
> 3 3 Berber
> 4 3 Shag
> Notice that Smith's Cars is not in the orders table at all.
> Now I select all the rows in the customer table and try to delete them. I'
d
> like the trigger to prevent the delete of any customer that has orders but
> allow the others to be deleted. So in this case Jones Lumber and Helen's
> Carpet would remain and Smith's Cars would be deleted.
> The trouble I'm having is that if I set up a cursor in the trigger to
> sequence through the customers, how do I rollback just some of the deletes
> but not all and put up an appropriate message?
> DECLARE
> @.iCustID AS INT,
> @.sMsg AS VARCHAR(500)
> SET NOCOUNT ON
> SET @.sMsg = ''
> DECLARE curCustomers CURSOR FOR SELECT C.CustID FROM DELETED C
> OPEN curCustomers
> FETCH NEXT FROM curCustomers INTO @.iCustID
> IF @.@.FETCH_STATUS = 0
> BEGIN
> WHILE @.@.FETCH_STATUS = 0
> BEGIN
> IF (SELECT COUNT(*) FROM tblOrders WHERE CustID = @.iCustID) > 0
> BEGIN
> ROLLBACK TRANSACTION
> SET @.sMsg = 'Customers with orders cannot be deleted.'
> END
> FETCH NEXT FROM curCustomers INTO @.iCustID
> END
> END
> IF @.sMsg <> ''
> RAISERROR (@.sMsg, 16, 1)
> CLOSE curCustomers
> DEALLOCATE curCustomers
>
> ===
> My original trigger looked like this until I realized it was rolling back
> the whole thing without even attempting to test for rows that should be
> allowed to be deleted:
> IF (SELECT COUNT(*) FROM tblOrders WHERE CustID IN (SELECT CustID FROM
> DELETED)) > 0
> BEGIN
> ROLLBACK TRANSACTION
> RAISERROR ('Customers with orders cannot be deleted.', 16, 1)
> END
> Thanks,
> Keith
Do not use cursors in triggers (or anywhere else you don't have to for
that matter).
I've included a solution below but I don't really see the point. Why
not just modify your original DELETE statement to exclude the
referenced rows using the NOT EXISTS check? The foreign key keeps you
safe from accidental deletes.
CREATE TRIGGER trg_customer
ON customer INSTEAD OF DELETE
AS
IF EXISTS
(SELECT *
FROM deleted
WHERE EXISTS
(SELECT *
FROM orders
WHERE custid = deleted.custid))
RAISERROR ('Customers with orders cannot be deleted.', 16, 1);
DELETE FROM customer
WHERE EXISTS
(SELECT *
FROM deleted
WHERE custid = customer.custid)
AND NOT EXISTS
(SELECT *
FROM orders
WHERE custid = customer.custid);
GO
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Ok so just so I understand your strategy, a rollback is not necessary since
you doing INSETAD OF and are putting up a warning if there are any rows that
cannot be deleted and then actually performing the delete on the allowed
rows within the trigger?
The foreign key won't help me here. The actual project is slightly more
complex but my sample got the point across and your solution should do the
trick nicely. Very much appreciated.
What's the reason for avoiding cursors? Is it a performance issue or are
there other reasons?
Thanks again,
Keith
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1140822038.662268.199890@.e56g2000cwe.googlegroups.com...
Do not use cursors in triggers (or anywhere else you don't have to for
that matter).
I've included a solution below but I don't really see the point. Why
not just modify your original DELETE statement to exclude the
referenced rows using the NOT EXISTS check? The foreign key keeps you
safe from accidental deletes.
CREATE TRIGGER trg_customer
ON customer INSTEAD OF DELETE
AS
IF EXISTS
(SELECT *
FROM deleted
WHERE EXISTS
(SELECT *
FROM orders
WHERE custid = deleted.custid))
RAISERROR ('Customers with orders cannot be deleted.', 16, 1);
DELETE FROM customer
WHERE EXISTS
(SELECT *
FROM deleted
WHERE custid = customer.custid)
AND NOT EXISTS
(SELECT *
FROM orders
WHERE custid = customer.custid);
GO
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||I implemented your suggestion and it works fine if I swap the sections so
that the test for Raiserror is happening after the delete is actually done.
Otherwise nothing deletes for me if it's done in the order you have below.
Can you explain why?
Thanks,
Keith
CREATE TRIGGER trg_customer
ON customer INSTEAD OF DELETE
AS
DELETE FROM customer
WHERE EXISTS
(SELECT *
FROM deleted
WHERE custid = customer.custid)
AND NOT EXISTS
(SELECT *
FROM orders
WHERE custid = customer.custid);
IF EXISTS
(SELECT *
FROM deleted
WHERE EXISTS
(SELECT *
FROM orders
WHERE custid = deleted.custid))
RAISERROR ('Customers with orders cannot be deleted.', 16, 1);
GO
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Never mind on this question. It works fine either way.
"Keith G Hicks" <krh@.comcast.net> wrote in message
news:e6xNt2ZOGHA.2604@.TK2MSFTNGP09.phx.gbl...
I implemented your suggestion and it works fine if I swap the sections so
that the test for Raiserror is happening after the delete is actually done.
Otherwise nothing deletes for me if it's done in the order you have below.
Can you explain why?
Thanks,
Keith|||There are several reasons to avoid cursors. Set-based operations generally
perform better: heap and index maintenance can be optimized, and transaction
logging is minimized. In addition, triggers fire only once for a set-based
operation, whereas they fire once per iteration for a row-based operation.
But these aren't the only reasons. Cursors reduce the effective isolation
level to REPEATABLE READ if a transaction is outstanding or to READ
COMMITTED if one isn't. Also, if a transaction is outstanding and
modifications occur within the fetch loop, the probability of deadlocks
increases significantly. You should know that a transaction is always
outstanding within the body of a trigger. While there are rare occasions
where a cursor will improve performance, all of the above factors must be
taken into account before converting a set-based solution into a row-based
one. An important note: you should always attempt a set-based solution
first, and only after every other option has failed, such as adding indexes,
hints, and ultimately SET FORCEPLAN, should you convert a set-based solution
to a row-based one. As you can see, cursors are not for the uninitiated.
"Keith G Hicks" <krh@.comcast.net> wrote in message
news:%23uVtziZOGHA.1676@.TK2MSFTNGP09.phx.gbl...
> Ok so just so I understand your strategy, a rollback is not necessary
> since
> you doing INSETAD OF and are putting up a warning if there are any rows
> that
> cannot be deleted and then actually performing the delete on the allowed
> rows within the trigger?
> The foreign key won't help me here. The actual project is slightly more
> complex but my sample got the point across and your solution should do the
> trick nicely. Very much appreciated.
> What's the reason for avoiding cursors? Is it a performance issue or are
> there other reasons?
> Thanks again,
> Keith
> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> news:1140822038.662268.199890@.e56g2000cwe.googlegroups.com...
>
> Do not use cursors in triggers (or anywhere else you don't have to for
> that matter).
> I've included a solution below but I don't really see the point. Why
> not just modify your original DELETE statement to exclude the
> referenced rows using the NOT EXISTS check? The foreign key keeps you
> safe from accidental deletes.
> CREATE TRIGGER trg_customer
> ON customer INSTEAD OF DELETE
> AS
> IF EXISTS
> (SELECT *
> FROM deleted
> WHERE EXISTS
> (SELECT *
> FROM orders
> WHERE custid = deleted.custid))
> RAISERROR ('Customers with orders cannot be deleted.', 16, 1);
> DELETE FROM customer
> WHERE EXISTS
> (SELECT *
> FROM deleted
> WHERE custid = customer.custid)
> AND NOT EXISTS
> (SELECT *
> FROM orders
> WHERE custid = customer.custid);
> GO
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>|||Thanks for all the info Brian.

delete trigger

I am trying to create a trigger where if the check box iin infopath is
checked then it deletes the whole record from the database. I am not sure
where to even start on this trigger. Please Help.Hi Ben
You may get a better response on how infopath works in
microsoft.public.infopath
John
"Ben Watts" wrote:
> I am trying to create a trigger where if the check box iin infopath is
> checked then it deletes the whole record from the database. I am not sure
> where to even start on this trigger. Please Help.
>
>

delete trigger

I am trying to create a trigger where if the check box iin infopath is
checked then it deletes the whole record from the database. I am not sure
where to even start on this trigger. Please Help.Hi Ben
You may get a better response on how infopath works in
microsoft.public.infopath
John
"Ben Watts" wrote:

> I am trying to create a trigger where if the check box iin infopath is
> checked then it deletes the whole record from the database. I am not sure
> where to even start on this trigger. Please Help.
>
>

Friday, February 24, 2012

Delete statement times out and blocks reads

Hi. Periodically I need to run a delete statement that deletes old data. The problem is that this can timeout using ODBC (via the CDatabase and CRecordSet classes in legacy code). Also, while its running the delete, the table its operating on is locked and my application can't continue to run and operate on rows not affected by the delete.

Are there any workarounds for this? Can the timeout be set in the connect string?

Thanks,

Brian

No, you will have to set the timeout value on the appropiate command object.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Delete Rows At The Publisher

I have some rows I need to delete at the publisher but I don't want to
replicate these deletes to the subscribers. Is there any easy way to do
this?
tia
Tina
Tina - what type of replication are you using?
rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||I'm using merge replication.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23wR$X61xEHA.2348@.TK2MSFTNGP12.phx.gbl...
> Tina - what type of replication are you using?
> rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||It's easier for transactional, but for merge, you could
disable the triggers on these tables then make the
changes then reenable the triggers.
rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Sounds easy enough.
Thanks Paul!
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:4cb001c4c7d3$ac18cd70$a401280a@.phx.gbl...
> It's easier for transactional, but for merge, you could
> disable the triggers on these tables then make the
> changes then reenable the triggers.
> rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>