Re: Using OPENROWSET and fileds order...

From: Jacco Schalkwijk (jacco.please.reply_at_to.newsgroups.mvps.org.invalid)
Date: 09/15/04


Date: Wed, 15 Sep 2004 10:51:09 +0100

In a relational database, there is logically no order in the columns in a
table, and you shouldn't rely on the order of the columns in your code. You
can just explicitly define the column list in your select statement, if you
need the columns to be returned in a particular order.

-- 
Jacco Schalkwijk
SQL Server MVP
"Dave" <Dave@discussions.microsoft.com> wrote in message 
news:D7548AE4-DE65-4A77-825A-24BAB456B477@microsoft.com...
> Hello,
>
> I'm trying executing this command on the SQL query analyzer:
>
> SELECT * FROM OPENROWSET
> ('Microsoft.Jet.OLEDB.4.0','..path..';'Admin';'',MyTable)
>
> It returns the right set of rows from the mdb source, however the order of
> the fileds of MyTable has changed, and has been sorted alphabetically.
>
> I need the original field (columns) order, not changed.
>
> Is there something I'm missing?
>
> TIA.
> Dave
>
> 


Relevant Pages

  • Re: Database Role & Application
    ... Dejan Sarka, SQL Server MVP ... "Dave" wrote in message ... > What is the basic difference between these roles.. ...
    (microsoft.public.sqlserver.security)
  • Re: Create a table on the fly with SP
    ... You can using OPENQUERY which calls the procedure, but IMO that is a hack... ... Tibor Karaszi, SQL Server MVP ... "Dave" wrote in message ...
    (microsoft.public.sqlserver.programming)
  • Re: alter tables add 365 columns
    ... Aaron [SQL Server MVP] wrote: ... why are you bothering to use a database for this? ... The whole point of a relational database is that ... This email account is my spam trap so I ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL DB Admin Software?
    ... Aaron Bertrand ... SQL Server MVP ... "Dave" wrote in message ... > I am a new DB Admin soon to be programer too. ...
    (microsoft.public.sqlserver.server)
  • Re: SQL DB Admin Software?
    ... Dave ... Some management tools are listed here. ... Aaron Bertrand ... SQL Server MVP ...
    (microsoft.public.sqlserver.server)