By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,415 Members | 1,568 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,415 IT Pros & Developers. It's quick & easy.

bcp command

P: 83
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
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
Here you go




-- CK
Oct 20 '08 #2

P: 83
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.