SQL Server Forums
Profile | Register | 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()
 New Topic  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
2224 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
2224 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
2224 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  
 New 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 0.06 seconds. Powered By: Snitz Forums 2000