Results 1 to 2 of 2

Thread: OpenRowset

  1. #1
    Join Date
    Feb 2005
    Posts
    25

    Question Unanswered: OpenRowset

    I can successfully retreive data using:

    Declare @Path varchar(100)
    Declare @CommandString varchar(100)
    Set @Path = ''
    Set @CommandString = 'Select * from [myTable.csv]'

    EXEC('SELECT *
    from OpenRowset(''MSDASQL'', ''Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=\\myServer\myShare\db\' + @Path + ';'',''' + @CommandString + ''')')

    Does anyone know an easy method to get column names into a table using OpenRowset

  2. #2
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    Quote Originally Posted by db0
    Does anyone know an easy method to get column names into a table using OpenRowset
    I'm not sure what you mean? do you want to choose column names with parameters? or are you asking about how to do an insert?

    its the use of the word INTO
    'splain lucy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •