Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. exporting Table to Excel file by TSQL Problem

exporting Table to Excel file by TSQL Problem

Scheduled Pinned Locked Moved Database
databasehelpsql-servercomtesting
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mhd sbt
    wrote on last edited by
    #1

    hi all im trying to export table loan to excel file but i get this error in sql 2008 r2

    Msg 7308, Level 16, State 1, Line 2
    OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.

    my query is

    insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=D:\testing.xls;',
    'SELECT * FROM [Bankmellat$]') select * from BML.Loan

    anyone can help me for fix this problem thanks regards

    L 1 Reply Last reply
    0
    • M mhd sbt

      hi all im trying to export table loan to excel file but i get this error in sql 2008 r2

      Msg 7308, Level 16, State 1, Line 2
      OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.

      my query is

      insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
      'Excel 8.0;Database=D:\testing.xls;',
      'SELECT * FROM [Bankmellat$]') select * from BML.Loan

      anyone can help me for fix this problem thanks regards

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Try this[^].

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

      M 1 Reply Last reply
      0
      • L Lost User

        Try this[^].

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

        M Offline
        M Offline
        mhd sbt
        wrote on last edited by
        #3

        i do your solution but i get error and my problem is stable and i get error again.

        L 1 Reply Last reply
        0
        • M mhd sbt

          i do your solution but i get error and my problem is stable and i get error again.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          What error? The same error? Or another? Are you on a 64-bit machine?

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

          M 1 Reply Last reply
          0
          • L Lost User

            What error? The same error? Or another? Are you on a 64-bit machine?

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

            M Offline
            M Offline
            mhd sbt
            wrote on last edited by
            #5

            yes i get the same error . yes my machine is 64 bit

            L 1 Reply Last reply
            0
            • M mhd sbt

              yes i get the same error . yes my machine is 64 bit

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              The JET-provider needs to be 64-bit too. Try downloading[^] the newer version.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups