i want somthing that works like MYSQL (Alter table order by column name)
Thanks & regards:
Aleem
--
Message posted via http://www.sqlmonster.com
>hi,
>i have a table with 500+ records and they got jumble while inserting . now i
>want to arrange them in order by column name in the table structure not in
>result set..
>
>i want somthing that works like MYSQL (Alter table order by column name)
>
>
>Thanks & regards:
>Aleem
Hi Aleem
I am not sure what you mean by jumbled up. The order of the columns
will be the same as the order you created the table. If the table was
created as the result of a SELECT..INTO change the order of the
columns in the SELECT clause and your table will have been created in
that order.
SELECT * is considered bad practice, if you want to change the order
so that you don't have to specify a column lists then you need to drop
the idea! You should only be selecting what you want and then column
order will be what you specify.
Just because MYSQL behaves that way doesn't mean that other systems
will, and if you want you application to be portable then don't rely
on features that are not standard. It could be that future releases of
MYSQL may not behave that way.
John
1,2,3,4.......21,22,41,42,43,...81,82,23,24......39,40.
John Bell wrote:
>>hi,
>>i have a table with 500+ records and they got jumble while inserting . now i
>[quoted text clipped - 5 lines]
>>Thanks & regards:
>>Aleem
>Hi Aleem
>
>I am not sure what you mean by jumbled up. The order of the columns
>will be the same as the order you created the table. If the table was
>created as the result of a SELECT..INTO change the order of the
>columns in the SELECT clause and your table will have been created in
>that order.
>
>SELECT * is considered bad practice, if you want to change the order
>so that you don't have to specify a column lists then you need to drop
>the idea! You should only be selecting what you want and then column
>order will be what you specify.
>
>Just because MYSQL behaves that way doesn't mean that other systems
>will, and if you want you application to be portable then don't rely
>on features that are not standard. It could be that future releases of
>MYSQL may not behave that way.
>
>John
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/201008/1
It's fundamental in SQL that if you want a certain order of a query, you
need to use an ORDER BY clause.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx