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

Stored procedure to change existing data

Status
Not open for further replies.

2969

IS-IT--Management
Oct 18, 2001
107
US
hi,

I have a table that has defaults defined for each column. How can i change the existing data in this table to be set as default where NULLs are present. Actually I just managed to set-up defaults for each column so any new data will be correct, now the question is to how to take care of the already exisitng data. Is there any stored procedure I can run.
 
2969,

Sounds like this is one-off job, right? If so, why bother with a stored procedure. You only need a single line of code, something like this:

USE MyTable
REPLACE MyField with MyDefaultValue FOR ISNULL(MyField)

(OK, that's two lines, but still ... )

Does that answer your question?

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top