how can chage column positions

  • create table Dept(Deptno int constraint Deptno_Pk Primary Key,DName varchar(50),Loc varchar(50))

    In table column order is like that

    Deptno,DName,Loc

    I need column order like that

    DName,Deptno,Loc

    is it possible or not?

  • Why? Column order has no meaning in SQL. If you want to retrieve the columns in a particular order, specify the order in your select statement.

    To change the order that the columns are defined in the metadata (which is the only place the order is), requires that the entire table be recreated.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply