Solved

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

Posted on 2011-03-23
2
341 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL SELECT query help 7 56
ServiceCenter IR Query Expressions 1 40
MySQL Sub-Select Query Returning Duplicate Result 7 45
Is Dropbox the only way to upload large files? 3 43
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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…

809 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