export data into text file

  • When I ran this line

    Insert into OpenRowset('MSDASQL', 

      'Driver={Microsoft Text Driver 

      (*.txt; *.csv)};

      DefaultDir=C:\External;',

      'select top 5 * from

    Serverlist1.txt') select * from table1

     

    I get this message and need your help

    Msg 7390, Level 16, State 2, Line 2

    The requested operation could not be performed because OLE DB provider "MSDASQL" for linked server "(null)" does not support the required transaction interface.

    Thank you.

  • This was removed by the editor as SPAM

  • I'm having issues also with exporting to excel but I've been using this :

     

    CREATE Procedure [ExportToExcelSheet](@fileName varchar(255))

    as

    Declare @sql varchar(1000)

    Set @sql ='

    insert into OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',

    ''Excel 8.0;Database='+@fileName+';HDR=YES'',

    ''SELECT * FROM sheet1$'')

    select * from tblcustomer'

    Exec (@sql)

     

    Now run this providing the excel file

    exec ExportToExcelSheet 'c:\testing.csv'

    If you have any joy please let me know

  • What's interesting is that the error message refers to "linked server ('null')."  I wonder whether your linked servers are properly configure and whether the SERVERNAME is set on all of them (try select @@servername to get the server's name).


    Regards,

    Carlos

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

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