Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add a column and update it

Status
Not open for further replies.

fikir

Programmer
Jun 25, 2007
86
I am trying to add a column to existing table and update it

it is erroring out

here is the code

alter table employee add stu_id numerin(10)

update employee
set stu_id = e2.stu_id
from employee e1 inner join employee2 e2
on e1.id = e2.id

Thanks,
 
[!]numerin[/!]

Sometimes spelling is importanrt.

If this column is going to store whole numbers (without fractional components), I would advise you to use integer.

[tt][blue]alter table employee add stu_id int[/blue][/tt]

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
geoprge sorry for the wrong spelling,

this thing is funny

when I execute each statement separate, it works fine.
but executed together, it failes and the error is

invalid column name stu_id

any suggestion

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top