[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1063
  • Last Modified:

How do I add a new Column at a specific position?

I am using the below T-SQL script to modify a table:

ALTER TABLE [dbo].[TBLUSERS1]
      ADD [USERPASSWORDDATE] [smalldatetime] NULL
GO

I would like to add the new column at a specific position in the table.  Is there a way to do this?  Right now, when I run this script, it tacks the new column on the end of the table.  I need the new column at a specific location because some programs in my application need particular fields at certain positions.

Thanks for any help
0
jsprenk55
Asked:
jsprenk55
1 Solution
 
wyckedone1Commented:
You can use the Enterprise Manager to move the column.  Just right-click the table name and choose Design.  At that point, left-click once on the row of the column name you want to move (to highlight it) and then click again and drag/drop.

To insert it with an SQL statement, you can find that answer here:

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20774391.html
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now