Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Delete records from multiple tables w/ a single query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-23 : 19:54:42
CuTiE;) writes "
Hi
Am using SQL Server 7.0
I have two tables, MailHeaders & EmailData
The MailHeaders table contains a one-to-many relation (EmailDataID field) with the MailData table.

I want to delete records from both tables with a single SQL query.

I wrote the follwing query:

Delete MailHeaders, EmailData
where EmailDataID = EmailData.ID
and MailHeaders.FolderID = 4

but an error occured : Incorrect syntax near ','.

I don't know if its possible to delete both tables!
can u help me plzzzzz!!
thanx alot ;)"
   

- Advertisement -