Solved

Need to insert a static value into a field in all records of my DB

Posted on 2011-03-23
2
335 Views
Last Modified: 2012-05-11
I have a database with thousands of records. I need to change one field to a value of 1 for each record in the database.

Something like...
INSERT INTO mydataset (myfield) VALUES (1)

but I don't think that is looping through the DB. I want to do this with an SQL query directly, no PHP.

thanks.
brian
0
Comment
Question by:befidled
2 Comments
 
LVL 19

Accepted Solution

by:
Rikin Shah earned 500 total points
ID: 35204569
UPDATE mydataset
SET  myfield = '1'
--put a Where conditions if any
0
 
LVL 1

Author Closing Comment

by:befidled
ID: 35207643
Perfect, thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now