T-SQL Add Column In Specific Order
Posted
by Aren B
on Stack Overflow
See other posts from Stack Overflow
or by Aren B
Published on 2010-06-03T17:20:56Z
Indexed on
2010/06/03
17:24 UTC
Read the original article
Hit count: 185
Im a bit new to T-SQL, Coming from a MySQL background Im still adapting to the different nuances in the syntax.
Im looking to add a new column AFTER a specific one. I've found out that AFTER
is a valid keyword but I don't think it's the right one for the job.
ALTER TABLE [dbo].[InvStockStatus]
ADD [Abbreviation] [nvarchar](32) DEFAULT '' NOT NULL ;
This is my current query, which works well, except it adds the field at the end of the Table, Id prefer to add it after [Name]
. What's the syntax im looking for to represent this?
© Stack Overflow or respective owner