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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Alter table

Author  Topic 

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2009-10-13 : 11:43:50
Hi is it not possible to do the following??

create table #test1 (column1 varchar(max))
-------- Table created awhile back

--- Trying to add column
alter table #test1 add column2 varchar(max) after column1

Any ideas?

Thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-10-13 : 11:57:19
"after column1"?

What's that?

I think you cannot give the order of columns to appear. They always will be appended.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2009-10-13 : 11:57:53
wanting to add a column after the column specified

quote:
Originally posted by webfred

"after column1"?

What's that?

I think you cannot give the order of columns to appear. They always will be appended.


No, you're never too old to Yak'n'Roll if you're too young to die.

Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-10-13 : 11:59:38
No way without recreating the whole table.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2009-10-13 : 12:00:30
oh..ok thanks for clearing that up

quote:
Originally posted by webfred

No way without recreating the whole table.


No, you're never too old to Yak'n'Roll if you're too young to die.

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-10-14 : 01:57:53
quote:
Originally posted by cipriani1984

wanting to add a column after the column specified

quote:
Originally posted by webfred

"after column1"?

What's that?

I think you cannot give the order of columns to appear. They always will be appended.


No, you're never too old to Yak'n'Roll if you're too young to die.




Ordinal position doesnt matter as long as you use them in the right place in the SELECT statement

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -