Getting column names from a linked server

  • Hi everybody, thanx for reading my words. I'm working with a couple of MSAccess97 linked servers to exchange data with a MSSQL 7.0 SP4 server. I'd like to know the best approach to retrieve the column names from the tables belonging to the linked server, just like querying syscolumns for a local server. Of course, better overall solutions are welcome, but I can't change the server configuration.

    The reason why I'm asking is that

    'SELECT * FROM [REMOTESERVER]...

    '

    returns the column names in alphabetical order, rather than in ordinal position.

    Thanx and keep up the great work!

    Lorenzo

  • Maybe you can try this command.

    EXEC sp_columns_ex 'yourlinkedservername', 'yourlinkedtablename'

  • Thanx a lot, it works!

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

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