Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Will the UPDATE command for SQL work if the table is empty? Basically, if I want to insert a whole bunch of stuff into my table, do I HAVE to use the INSERT command to put stuff in the table then use UPDATE after that or can I use UPDATE to insert stuff right from the beginning?

Thanks,

Tehon

  • *Experts*
Posted

You must use INSERT.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • Leaders
Posted

tehon, your posts keep getting moved for a reason. pls pay attention to the forum titles and post them where it makes sense (ie. a database question in the database forum).

 

Inserts insert data and Updates update existing data.

--tim
Posted
Sorry. How come when I use the update command, it inserts the same thing in every row? It inserts the last thing that is suppose to be inserted, in every row.

Thanks,

Tehon

  • *Experts*
Posted

Your update is not inserting, it is updating every row. I would guess that you have no WHERE clause on your UPDATE, and hence it affects every row. To know why, we'd have to see the code that does the UPDATE.

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...