我如何正确使用bcp? [英] How o I use bcp properly?

查看:110
本文介绍了我如何正确使用bcp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

*我安装了visual studio 2013终极版,其中包括sql 2012快递版

*我使用visual studio中的managemnt工作室创建了一个数据库

*现在我的问题是我想使用bcp备份其中一个数据库表

*我通过互联网搜索并按照说明写了我的查询,但每次我收到错误

*查询是

声明@sql varchar(8000)

选择@sql ='cd E:\> bcp pharmy_database2012.items out E:\bcptest3.txt -T -S(localDB)\ V11.0'

exec master..xp_cmdshell @sql



** ERROR IS

*i installed visual studio 2013 ultimate which includes sql 2012 express edition
* i made a database using the managemnt studio inside the visual studio
* now my problem is that i want to use bcp to back up one of database tables
*i googled through the internet and wrote my query as it stated but every time i get an error
* the query is
declare @sql varchar(8000)
select @sql = 'cd E:\>bcp pharmy_database2012.items out E:\bcptest3.txt -T -S (localDB)\V11.0'
exec master..xp_cmdshell @sql

** ERROR IS

output
Access is denied.
NULL









**一些附加信息

* SERVICENAME ------ LOCALDB#F469D3DB

* SERVERNAME ----- DESKTOP-2SORBMA \LOCALDB#F469D3DB

*驱动器的安全权限是完全可控的。





我想要的是输出非常大的数据----你可以吗?请帮帮我



我尝试了什么:



http:/ /www.sqlservercentral.com/Forums/Topic237238-8-1.aspx

http://dba.stackexchange.com/questions/31202/unable-to-open-bcp-host-data-文件错误

http://softescu.com/blog/knowledge-centre/error-microsoftsql-server-native-client-100unable-open-bcp-host-data-file-sql





**SOME ADDITIONAL INFORMATIONS
*SERVICENAME------LOCALDB#F469D3DB
*SERVERNAME -----DESKTOP-2SORBMA\LOCALDB#F469D3DB
*the drive e security permissions is under full controll


what i want is to export datatble of very large size ----can u help me please

What I have tried:

http://www.sqlservercentral.com/Forums/Topic237238-8-1.aspx
http://dba.stackexchange.com/questions/31202/unable-to-open-bcp-host-data-file-error
http://softescu.com/blog/knowledge-centre/error-microsoftsql-server-native-client-100unable-open-bcp-host-data-file-sql

推荐答案

您是否尝试阅读 xp_cmdshell 上的文档?你最好阅读它,这里 [ ^ ]。



密切关注备注和权限部分。他们会告诉你为什么你得到拒绝访问。
Did you try reading the documentation on xp_cmdshell? You better read it, here[^].

Pay close attention to the Remarks and Permissions sections. They'll tell you why you're getting "Access denied".


这篇关于我如何正确使用bcp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆