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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Insert a Column at Particular Index()
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

paramu
Posting Yak Master

151 Posts

Posted - 11/20/2013 :  08:30:07  Show Profile  Reply with Quote
Hi, Iam using SQL Server2012. Is it possible to insert a new_column to table at 10th of it's column_index ?

Ofcourse I can select, but I wish to insert at particular index...Is it possible?

Alter table Table1 add New_Column varchar(20) at 10 ??????

Thanks

Paramu @ PARANTHAMAN

bandi
Flowing Fount of Yak Knowledge

India
2241 Posts

Posted - 11/20/2013 :  08:35:04  Show Profile  Reply with Quote
we can not...

if you wish to get
1) rename old table ( tab1 to tab2)
2) create table new table with old table name(tab1) and new column at specific column index
3) copy data from tab2 to tab1

--
Chandu
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2241 Posts

Posted - 11/20/2013 :  08:35:23  Show Profile  Reply with Quote
Reference
http://blog.sqlauthority.com/2013/03/11/sql-server-how-to-add-column-at-specific-location-in-table/

--
Chandu
Go to Top of Page

paramu
Posting Yak Master

151 Posts

Posted - 11/20/2013 :  08:37:47  Show Profile  Reply with Quote
Thanks

Paramu @ PARANTHAMAN
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2241 Posts

Posted - 11/20/2013 :  08:38:59  Show Profile  Reply with Quote
welcome :)

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 2.91 seconds. Powered By: Snitz Forums 2000