exec master.dbo.xp_cmdshell 'BCP "select UserName UserPassword from bbs user" queryout e:\bbs.txt -c -Sserver -Uadministrator -P123456'

解决方案 »

  1.   

    应该改为-Usa -Psa的密码,或者可以使用其他SQLServer可以识别的用户名和密码
    祝你好运
    开心就好!!!!
      

  2.   

    我是windows 登陆认证的啊,换了sa也没有用.
      

  3.   

    -T指定 bcp 使用网络用户的安全凭据,通过信任连接连接到 SQL Server。不需要 login_id 和 password
      

  4.   

    如果你是信任连接用exec master.dbo.xp_cmdshell 'BCP "select UserName UserPassword from bbs user" queryout e:\bbs.txt -c -Sserver -T'
    如果你以SA用户操作用:exec master.dbo.xp_cmdshell 'BCP "select UserName UserPassword from bbs user" queryout e:\bbs.txt -c -Sserver -Usa -P123456'