PDA

View Full Version : sql insert


simon157
11-08-2007, 09:25 AM
Hi, I hope someone can help. I have a database called Backgarden and within that a table called species. I would like to insert into one of the table fields called 'class' the value 'macro'. Could some possibly tell me how I would do this on all the records entries in the table. I'm sure it's very easy but I'm not havin much luck.

Thanks

Simon

Vege
11-08-2007, 05:54 PM
alter table species add `class` varchar(255) not null
would add new column to table or are you speaking about normal insert?

I have seen u in these forums before, but be specific what sql server you are using as sql syntax is not entirely same for all.

joebert
11-08-2007, 07:49 PM
UPDATE `species` SET `class`='macro' WHERE 1

DarkStreetDev
11-12-2007, 10:54 AM
Or for MS SQL simply say:

UPDATE species SET class = 'macro'