Need a little help with this,  just learning SQL server and am trying to
convert over from ACCESS.

In ACCESS my query looks like:

DELETE table1.*, table2.*  FROM  table1 LEFT JOIN table2 ON table1.field=
table2.field
WHERE table1.field = variable;

and works fine

but removing *s does not work.  works if only deleting from one table.

DELETE table1, table2  FROM  table1 LEFT JOIN table2 ON table1.field=
table2.field
WHERE table1.field = variable;

IN SQL  when deleting, the *s are left out, I get this to work fine when
only deleting from
one table, I get the error message, when I remove the *s:

Incorrect syntax near ','  How do you delete from more than one table at a
time with SQL?

I can get around this by changing to 2 queries:

1) del records in table 1 based on variable
2) del records in table 2 based on variable

but I should be able to keep in one query, similar to the one used for
ACCESS. 

some help please
Rodney

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to