Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 add column and insert

Author  Topic 

seanrock
Starting Member

2 Posts

Posted - 2007-03-14 : 10:06:18
hi

i'm adding a column to a table and (trying to)inserting a value but i'm getting an stating that the column is not valid.

alter table [News] add [StartDate] [datetime]
alter table [News] add [EndDate] [datetime]

update [News] set [StartDate] = GETDATE()

thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-14 : 10:08:36
[code]
alter table [News] add [StartDate] [datetime]
alter table [News] add [EndDate] [datetime]
GO
update [News] set [StartDate] = GETDATE()
[/code]


KH

Go to Top of Page

seanrock
Starting Member

2 Posts

Posted - 2007-03-14 : 10:35:28
ah! thanks
Go to Top of Page
   

- Advertisement -