Jump to content
Fórum Script Brasil
  • 0

Como exportar o resultade de uma consulta ?


BrunoKNS

Question

6 answers to this question

Recommended Posts

  • 0
Poderá utilizar a funcionalidade OPENROWSET do sql.

http://msdn.microsoft.com/pt-br/library/ms190312.aspx

Obrigado pela ajuda, porem agora apresenta os seguintes erros:

Msg 7403, Level 16, State 1, Line 2

The OLE DB provider "Microsoft.Jet.OLEDB.12.0" has not been registered.

Msg 7403, Level 16, State 1, Line 1

The OLE DB provider "Microsoft.Jet.OLEDB.8.0" has not been registered.

Msg 7308, Level 16, State 1, Line 1

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.

Fiz alterações no código e identifiquei esses erros

Link to comment
Share on other sites

  • 0

A sua sintaxe ficou parecida com isto? (digo parecida pois há outras formas a sintaxe).

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

O erro que pode ocorrer é erro de falta de acesso:

http://blog.sqlauthority.com/2008/01/02/sq...part-of-the-se/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652.1k
×
×
  • Create New...