Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005
    Posts
    58

    Unanswered: OpenRowset char conversion

    I'm trying to run the following statement. If the first row of invoie data has a number the invoice for the rest of the rows that contain text come through as null. If the first row of data is text i'm fine. How do I convert the invoice to text as it is being read from the below statement?

    Set @tsql = 'insert into #Draw_File_Data (Folder, Vendor, Invoice, Dist_Seq, Draw)
    select Folder, Vendor, Invoice, [Dist_Seq], [Draw] from OpenRowset(''MSDASQL'', ''Driver={Microsoft Text Driver (*.txt; *.csv)};
    DefaultDir=' + @path + ';'',''select Folder, Vendor, cast(Invoice as varchar(50)), [Dist_Seq], [Draw] from [' + @draw_file + ']'')'


    Exec (@tsql)

  2. #2
    Join Date
    Oct 2005
    Posts
    58
    Found it here:
    http://www.sqldts.com/default.aspx?254

    Thanks to those of you who viewed.

Posting Permissions

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