467,915 Members | 1,221 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

bcp command

is't true bcp command is use to import/export data from database to plain text file?
if not can i have to know each syntax to use importing data from certain column of excel file to database
Oct 19 '08 #1
  • viewed: 2338
Share:
2 Replies
ck9663
Expert 2GB
Here you go




-- CK
Oct 20 '08 #2
Expand|Select|Wrap|Line Numbers
  1. /*sp_configure 'Ad Hoc Distributed Queries', 1 
  2. reconfigure 
  3. SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 
  4.    'Excel 8.0;Database=C:\structure.xls', Peribadi$)
  5. ERR:
  6. Msg 15281, Level 16, State 1, Line 3
  7. SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online. 
  8. */
  9. SELECT * FROM OPENQUERY(EXCELLINKS, 'SELECT * FROM [Peribadi$]')
  10. /*Msg 102, Level 15, State 1, Line 1
  11. Incorrect syntax near '\'.
  12. Msg 7399, Level 16, State 1, Line 9
  13. The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "EXCELLINK" reported an error. The provider did not give any information about the error.
  14. -+OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "EXCELLINK" returned message "Could not find installable ISAM.".
  15. -+OLE DB provider "SQLNCLI" for linked server "EXCELLINKS" returned message "Invalid connection string attribute".
  16. Msg 7303, Level 16, State 1, Line 9
  17. Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "EXCELLINK".
  18. */
Nope...I had enough.....better with DTS/SSIS
Oct 20 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by TEK | last post: by
8 posts views Thread by Siemel Naran | last post: by
34 posts views Thread by Roman Mashak | last post: by
13 posts views Thread by Chris Carlen | last post: by
reply views Thread by czerwww | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.