We help IT Professionals succeed at work.

SQL code to delete one specific record from a table?

Michael2008
Michael2008 asked
on
245 Views
Last Modified: 2011-10-19
What would be the SQL code to delete the record in a table containing a specific ID 1 and ID 2 dual primary key in MS Access 2003?
Comment
Watch Question

Jim HornSQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015

Commented:
{Access}
DELETE * FROM YourTable WHERE ID IN (1, 2)

Never heard of a 'dual primary key'.  Can you give me a 'for example'?

Author

Commented:
I don't know what you Access Gurus call it, but i call it a dual primary key, where you have 2 fields as the primary key, so you can have repeats in a single field, but no duplicate combinations.  See example db if you want an example
Dual-Primary-Key-Example.mdb
SQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Worked like a charm; thanks for the help.

Author

Commented:
Thanks again
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.