Reset to default in SQL

J

Joey Martin

Is it possible to reset a SQL field to it's default setting? For
example, someone changes FIELD1 to "John Doe" and the the default is
"YOUR NAME". Can I reset it back to "YOUR NAME" somehow?

Thanks for the help.
 
B

Bob Barrows

Joey said:
Is it possible to reset a SQL field to it's default setting? For
example, someone changes FIELD1 to "John Doe" and the the default is
"YOUR NAME". Can I reset it back to "YOUR NAME" somehow?

Thanks for the help.
I'm not quite sure I understand: if you know the default value, just

UPDATE table set FIELD1 = 'YOUR NAME'
WHERE FIELD1='John Doe'

Is that what you're after?

Or do you want a query that will work whatever the default value is? If so,
you can use the DEFAULT keyword:

UPDATE table set FIELD1 = DEFAULT
WHERE FIELD1='John Doe'

HTH,
Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top