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
 Create a column

Author  Topic 

Trininole
Yak Posting Veteran

83 Posts

Posted - 2010-06-04 : 11:23:23
How do you create a column name in sql without altering a table??

Roger DeFour

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-04 : 11:27:15

Did you mean this?

select *,1 as new_col from your_table

Madhivanan

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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-06-05 : 06:59:15
or do you mean this?

select *,1 as new_col into dest_table from your_table


creates the derived column in dest_table

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-06-05 : 10:28:54
What's wrong with ALTER?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-07 : 03:02:34
quote:
Originally posted by X002548

What's wrong with ALTER?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam






What's wrong with Derived Column?


Madhivanan

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

- Advertisement -