Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1668
  • Last Modified:

SQL bcp problem

I used the command
bcp "Student.dbo.Student3" in C:Student.csv -fc:\Student.fmt -Scsm33068 -Usa

it then asks for my password but when I enter it it gives an error message:

SQLstate = 28000, NativeError=18452
error = login failed for user sa
reason Not associated with a trusted SQL server

Any ideas?
0
Kegan5
Asked:
Kegan5
  • 4
  • 2
1 Solution
 
danblakeCommented:
Your server is setup to use Windows Authentication only.

You also should not have a blank password specified.
-P<pswd> should be used to define the password.

Try using the -T to use your NT account in the BCP command syntax.

Otherwise you will need to reconfigure your server for both Windows Authentication & SQL Server authentication.

Right Click on the Server in EM, select properties, select the security tab.
Here you can modify to Win Authentication only or SQL Server authentication.
0
 
Kegan5Author Commented:
I have set the password with -Ppassword

it then asks for password: when I enter password in here again it gives me the same error message as above
0
 
danblakeCommented:
Did you also check if your server was in Windows Authentication mode only ?

(Like the suggestion above ?)
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
danblakeCommented:
If the server is in Windows Authentication mode only it is usual for the error message:
SQLstate = 28000, NativeError=18452
error = login failed for user sa
reason Not associated with a trusted SQL server

to be returned.

You need to configure the server for windows / sql server authentication to have a 'sa' account available.
0
 
Kegan5Author Commented:
yeah I changed that but its still giving me the same error message
0
 
danblakeCommented:
Have you tried this with a trusted login (NT Login that has SYSADMIN permissions on the server/database) ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now