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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear table row

Status
Not open for further replies.

theoneweasel77

Programmer
Aug 10, 2004
54
0
0
US
Is there any quick way to clear a table row without deleting it?
 
that's a first

no, i don't think there is an easy way

actually, deleting it and then re-adding it with only the primary key would work

but that assumes all columns are nullable

could you give some more info please?

why in the world do you need to "clear" a row?

rudy
SQL Consulting
 
update the column to set everything back to the defaults (and/or)

Bastien

Cat, the other other white meat
 
delete the row, then add it again using only the value of the primary key:
Code:
delete from yourtable where pk=937
insert into yourtable (pk) values (937)

rudy
SQL Consulting
 
I suppose I'll just have to update the row clearing all the entries (besides the keys). I'm designing an online game and I want to clear a move list after the script is done processing the data for that round.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top