Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DELETE QUERY QUESTION - EASY

Posted on 2008-10-08
2
Medium Priority
?
175 Views
Last Modified: 2012-05-05
Simply put, I need to know how to implement a DELETE query within my SPROC that basically deletes ANY row WHERE GPS.TEXT_MESSAGE DOES NOT = '*Dispatched' or '*Starting Trip' or '*Ending Trip'

0
Comment
Question by:chrisryhal
2 Comments
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 2000 total points
ID: 22670562
Here you go:

delete from gps
where YourPrimaryKeyField not in
     (select YourPrimaryKeyField from gps where texT_message in ('*Dispatched','*Starting Trip', '*Ending Trip')
     )
0
 
LVL 2

Author Closing Comment

by:chrisryhal
ID: 31504308
PERFECT!!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Loops Section Overview

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question