Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to use BCP

Author  Topic 

sasikanth_kv
Starting Member

3 Posts

Posted - 2009-12-21 : 10:28:28
Hi all,

I am using BCP utility in SQL Server to export the data to a CSV file. But i am not able to proceed because i get the below error.

This is what i am executing in the SQL Server management studio
declare @sql varchar(8000)
select @sql = 'bcp Anglo.dbo.Account in c:\bcp\File_2009.csv -c -t , -T'

exec master..xp_cmdshell @sql

When i execute i get below error.

SQLState = 08001, NativeError = -2146893019
Error = [Microsoft][SQL Native Client]SSL Provider: The certificate chain was issued by an authority that is not trusted.
NULL
SQLState = 08001, NativeError = -2146893019
Error = [Microsoft][SQL Native Client]Client unable to establish connection
NULL

I have googled but couldnt find any solution. If someone can help me out in solving this issue it would be great.

Thanks
Sasi

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-12-21 : 11:01:29
You do not have a trusted connection to the database.

Use -U -P switches or change your level of access to the server.
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2009-12-21 : 11:01:50
Sounds like you may have to provide a username and password via bcp as your credentials are not enough.

what credentials are you using to connect to the database via management studio?

you can specify a user with the -U and the password with -P


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

sasikanth_kv
Starting Member

3 Posts

Posted - 2009-12-21 : 11:08:54
I get the same error even after i try giving username and password.

declare @sql varchar(8000)
select @sql = 'bcp Anglo.dbo.Account in c:\bcp\File_2009.csv -c -t , -T -Usa -Pqqqqqq'

exec master..xp_cmdshell @sql

SQLState = 08001, NativeError = -2146893019
Error = [Microsoft][SQL Native Client]SSL Provider: The certificate chain was issued by an authority that is not trusted.
NULL
SQLState = 08001, NativeError = -2146893019
Error = [Microsoft][SQL Native Client]Client unable to establish connection
NULL
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2009-12-21 : 11:29:57
you need to remove the trusted connection flag



Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2009-12-21 : 11:31:22
try bcp Anglo.dbo.Account in c:\bcp\File_2009.csv -c -t, -Usa -Pqqqqqq


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

sasikanth_kv
Starting Member

3 Posts

Posted - 2009-12-21 : 17:45:33
I couldnt succeed i still get the similar error. Am i missing any configuration settings or rights ?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-21 : 19:33:07
http://blogs.msdn.com/sql_protocols/archive/2007/06/27/install-a-self-signed-test-certificate-that-can-be-loaded-by-sql-server-automatically.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -