SQL - Cant add column :(

So I've been toying around with SQL because I need to learn how it works and all that jazz. Anyway, I tried what I thought was going to be a simple task of adding a new column to my table, and it never shows up! According to my object explorer it is there, but I can't see it or add anything to it. What is the issue here?? I have tried manually adding it, and I have tried using a script to add it. Neither work.

What do?
Maybe it is there, it's just not showing up because you don't have any data in it? Try adding new rows with data in that column and see if it works.
I tried that. The column doesn't even appear to enter data into
Show the code.
1
2
3
4
5
ALTER TABLE a_table
  ADD COLUMN new_column;
UPDATE a_table
  SET new_column=42
  WHERE new_column is NULL;
So if I added a new column, I just need to update the column as well?
I don't understand your question.
When you add a column, the elements that were in the table ¿which value they will have for that column?
I think that if you don't especify otherwise, the value will be NULL.

The column doesn't even appear to enter data into
¿what do you mean? ¿how are you trying to access it?
It's a char value in the column, Im not using the queries, I'm just straight accessing this table. As in clicking and typing values
Then don't say SQL, say what program you're using. SQL is a query language, so if you ask for it you'll get queries (though I can't imagine any reason why anyone would prefer "clicking and typing values" over just writing queries).
Last edited on
Yea sorry I was just trying to get a database up and running and I'm completely new to it all so I only know a few statements. Sorry for the confusion. I'm using a database in SQL server 2008
How exactly are you adding data to the table?
Manually. I found out if I close the table and reopen it, my new columns show up
I dont have SQL Server 2008, I use MySQL so I have no idea what you mean by manually. I assume it comes with a browser similar to MSAccess. In MySQL I use the query browser with SQL commands.
I don't see what is so confusing about it. I can view my table right? When I'm on my computer I guess I'll screenshot it
Topic archived. No new replies allowed.