Re: Alter Database Move column

From: Wayne Snyder (wsnyder_at_computeredservices.com)
Date: 05/22/04


Date: Sat, 22 May 2004 07:27:34 -0400

Although you didn't ask, Bob, it is often considered to be a flaw when we
depend on the physical ordering of the columns in a table... When I first
started doing this stuff many years ago, I tried to keep columns in tables
in a particular order, and found myself dropping/recreating tables all of
the time ( all on nights and weekends as well).

I encouraged the programmers to always use a column list and life got
better...

I'm not trying to tell you how to do your job, just making an observation
you might find helpful...

-- 
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Bob Clegg" <bclegg@clear.net.nz> wrote in message
news:%23cIRcW9PEHA.3304@TK2MSFTNGP12.phx.gbl...
> Hi,
> Is it possible to move a column using an SQL script?
> I have looked at the Alter Table syntax help but can't see any indication
of
> ordinal control .
> I have a table that I have had to add an indentity column to.
> I want to move it to pos 0.
> My script so far is :
> alter table MasterStationTest
> drop constraint pk_masterstationtest
>
> go
>
> alter table MasterStationTest
> add  id int
> IDENTITY(1,1)
> PRIMARY KEY
> go
> thanks
> Bob
>
>


Relevant Pages

  • Re: How to represent category, subcategory, product
    ... I waited days with no reply on a SQL Server ... Thanks Gene, Lennart, Neo, Bob for your suggestions, some very helpful ... Neo, your suggestion is intriguing, I'll be looking into it. ... haven't found any database counterparts of the libraries of algorithms ...
    (comp.databases.theory)
  • Re: Connextion Error After Installing SQL Server 2005 on Vista
    ... But Vista User Account Control doesn't automatically pass your administrator credentials to programs. ... The solution is to explicitly grant Bob access to SQL Server. ... During the installation, I was prompted a couple of times to install a service pack for Visual Studio 2005, which is not currently installed. ...
    (microsoft.public.sqlserver.connect)
  • Re: THANKS! -> Re: Valid MS Access SQL Syntax (Double JOINtedness)
    ... >> expanding my knowledge on the topic. ... >> Will the Access syntax work on SQL Server? ... > Bob Barrows. ... > quicker response by posting to the newsgroup. ...
    (microsoft.public.access.formscoding)
  • Re: THANKS! -> Re: Valid MS Access SQL Syntax (Double JOINtedness)
    ... >> expanding my knowledge on the topic. ... >> Will the Access syntax work on SQL Server? ... > Bob Barrows. ... > quicker response by posting to the newsgroup. ...
    (microsoft.public.sqlserver.programming)
  • Re: Problem altering table and adding a default
    ... ALTER TABLE dbo.Test_tbl ADD Notnull_col1 charNOT NULL ... SQL Server does not allow that - you can only add nullable columns. ... After you add a new column in Enterprise Manager, uncheck Allow Nulls, bind the uder- ... Start Profiler and perform a new trace. ...
    (microsoft.public.sqlserver.server)