delete from table ?

delete from table ?

Post by Shafi » Wed, 09 Aug 2000 04:00:00



Is there a way we can insert a check in a delete statement?

I mean if I write:

del from Table1

it erases all the rows from Table1.

I was thinking if I can write something which can give a msg (before erasing
rows)

'Ready to delete all the rows in Table1. Are you sure?'

so that I can avoid erasing rows by mistake.

Any suggestions,

TIA,

shafiq

 
 
 

delete from table ?

Post by Darren Brinksneade » Wed, 09 Aug 2000 04:00:00


That will have to be handled by your client application.

--
Darren Brinksneader
MCDBA, MCSE+Internet, CNE, MCT, CCA, CTT
VP Information Technology
A Technological Advantage, Inc.


Quote:> Is there a way we can insert a check in a delete statement?

> I mean if I write:

> del from Table1

> it erases all the rows from Table1.

> I was thinking if I can write something which can give a msg (before
erasing
> rows)

> 'Ready to delete all the rows in Table1. Are you sure?'

> so that I can avoid erasing rows by mistake.

> Any suggestions,

> TIA,

> shafiq


 
 
 

delete from table ?

Post by Shawn Clar » Wed, 09 Aug 2000 04:00:00


Shafiq,

Hmm... could you say a little bit of Microsoft programming. :) It is much
like when you right-click on your recycle bin and then click empty recycle
bin it prompts you if you want to empty it. Well if I went through the two
steps to get to the empty command I don't think I did that by mistake so why
should I need to confirm it. My point is that it is better to setup your
server such that only the users that you want to have control of such
commands to use them. Then you can make sure those users have been trained
properly so that when they are deleting data from tables that they either
have a recent backup of or are aware of the consequences.

The only other way would be to have your app parse the sql statement before
it is sent to the backend and if it finds DELETE in the statement to pop-up
a confirmation window.

--
Shawn Clark
Senior Software Consultant
Meridian Technology Group


Quote:

> Is there a way we can insert a check in a delete statement?

> I mean if I write:

> del from Table1

> it erases all the rows from Table1.

> I was thinking if I can write something which can give a msg (before
erasing
> rows)

> 'Ready to delete all the rows in Table1. Are you sure?'

> so that I can avoid erasing rows by mistake.

> Any suggestions,

> TIA,

> shafiq

 
 
 

1. ado .delete deletes joined table records?

Because ADO could not correctly figure out how to construct the DELETE
query?
Try to use this instead:

SELECT T1.Field1, T1.Field2,
               T2.Field1
                FROM T1, T2 WHERE T1.IdField  = T2.IDField

Sometimes this helps.

--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________


2. Can someone tell me why this doesn't work?

3. Newbie: ADOX Tables.Delete gives Table In Use

4. D3/NT Backup Error question

5. drop any table vs. delete any table

6. Newbie questions

7. Exclusive table locks when deleting from tables with clustered index

8. Help creating collection-like object

9. DTS package to delete SQL table and bring in AS400 table

10. DTS Copy, Delete, Empty tables?

11. Deleting a table column which has a default value

12. MSDE : delete a table

13. deleting a table from a mysql database