Click here to Skip to main content
15,880,543 members
Home / Discussions / Database
   

Database

 
GeneralRe: Check box = Unchecked Pin
Dave Kreskowiak21-Dec-07 9:51
mveDave Kreskowiak21-Dec-07 9:51 
This query won't update anything. It's an INSERT query, which means it creates new records.

There is also no WHERE clause, so even if you changes the INSERT to UPDATE, it would change ALL of the records in the table, not just the ones that have their [New?] field set to True.

You also don't specify which table your making an update to.

Your column name is also pretty bad. Don't use punctuation marks in table or column names. This will make for some very interesting debugging sessions if you do.

I think your query, assuming you want to change all the records that are tagged "new" to false and your [New?] column is of type "Yes/No", should look something like this:
UPDATE tableName
SET [New?] = False
WHERE [New?] = True



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007




GeneralRe: Check box = Unchecked Pin
GuyThiebaut23-Dec-07 10:44
professionalGuyThiebaut23-Dec-07 10:44 
GeneralDeleteing From Table A When Records Not Found in Table B Pin
gunner_uk200021-Dec-07 3:26
gunner_uk200021-Dec-07 3:26 
GeneralRe: Deleteing From Table A When Records Not Found in Table B Pin
Michael Potter21-Dec-07 4:24
Michael Potter21-Dec-07 4:24 
QuestionInserting bulk data to SQL DB (SQL 2000) [modified] Pin
Daminda21-Dec-07 1:51
Daminda21-Dec-07 1:51 
GeneralRe: Inserting bulk data to SQL DB (SQL 2000) Pin
pmarfleet21-Dec-07 2:23
pmarfleet21-Dec-07 2:23 
GeneralRe: Inserting bulk data to SQL DB (SQL 2000) Pin
Paddy Boyd21-Dec-07 2:27
Paddy Boyd21-Dec-07 2:27 
GeneralCustom Auto Generated ID Pin
xavier198821-Dec-07 0:58
xavier198821-Dec-07 0:58 
GeneralRe: Custom Auto Generated ID Pin
pmarfleet21-Dec-07 2:21
pmarfleet21-Dec-07 2:21 
GeneralDatabas connection with java script Pin
rajesh4u20-Dec-07 22:48
rajesh4u20-Dec-07 22:48 
GeneralRe: Databas connection with java script Pin
Colin Angus Mackay21-Dec-07 0:12
Colin Angus Mackay21-Dec-07 0:12 
GeneralRe: Databas connection with java script Pin
NetBot22-Dec-07 18:26
NetBot22-Dec-07 18:26 
QuestionHow to avoid the alphabetic order of the columns returned when selected from a SQL linked server. Pin
kalam20-Dec-07 22:34
kalam20-Dec-07 22:34 
AnswerRe: How to avoid the alphabetic order of the columns returned when selected from a SQL linked server. Pin
Paddy Boyd21-Dec-07 1:03
Paddy Boyd21-Dec-07 1:03 
QuestionSql Server Login Pin
cbkulathunge20-Dec-07 20:05
cbkulathunge20-Dec-07 20:05 
GeneralRe: Sql Server Login Pin
Paul Conrad22-Dec-07 7:05
professionalPaul Conrad22-Dec-07 7:05 
QuestionNeed Query for Searching Name from database. Pin
mithun narayanan20-Dec-07 19:20
mithun narayanan20-Dec-07 19:20 
GeneralRe: Need Query for Searching Name from database. Pin
That's Aragon20-Dec-07 19:31
That's Aragon20-Dec-07 19:31 
GeneralRe: Need Query for Searching Name from database. Pin
mithun narayanan20-Dec-07 20:04
mithun narayanan20-Dec-07 20:04 
GeneralRe: Need Query for Searching Name from database. Pin
mithun narayanan20-Dec-07 20:50
mithun narayanan20-Dec-07 20:50 
GeneralDate Pin
trilokharry20-Dec-07 17:49
trilokharry20-Dec-07 17:49 
GeneralRe: Date Pin
That's Aragon20-Dec-07 19:24
That's Aragon20-Dec-07 19:24 
GeneralRe: Date Pin
trilokharry21-Dec-07 0:54
trilokharry21-Dec-07 0:54 
GeneralGetting tables from a database Pin
MarkB77720-Dec-07 16:47
MarkB77720-Dec-07 16:47 
GeneralRe: Getting tables from a database Pin
pmarfleet20-Dec-07 21:18
pmarfleet20-Dec-07 21:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.