Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Statement 1

Status
Not open for further replies.

SA812

Technical User
Jan 14, 2002
66
0
0
US
Hi guys I’m looking to create a simple delete statement. I have a table that stores ref numbers. I want to delete the records in the column RefNo where the TenderTypeKey = 3.

It's basically the records that are returned in this select statement;
SELECT RefNo, TenderTypeKey
FROM dbo.tcmCashRcptDetl
WHERE (TenderTypeKey = 3)
I do not want to delete all the rows in the table with a TenderTypeKey of 3, just the records stored in the column RefNo.

Thanks in advance!
 
Records are not stored in column.
Record is the information stored in ALL columns of the table.
So what is your question again:
1. Delete records where TenderTypeKey = 3
or
2. Clear data from RefNo where TenderTypeKey = 3
?

If 1:
Code:
DELETE FROM dbo.tcmCashRcptDetl WHERE  (TenderTypeKey = 3)

2.
Code:
UPDATE  dbo.tcmCashRcptDetl SET RefNo = '' --0, NULL whatever value you want
WHERE (TenderTypeKey = 3)

In both cases make sure you have a really good backup first.


Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
I don't know why i didn't think of that. I guess i made the problem more complex that it should have been. I was looking to do option #2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top