[VIEWED 3974
TIMES]
|
SAVE! for ease of future access.
|
|
|
Chintamani
Please log in to subscribe to Chintamani's postings.
Posted on 08-09-08 1:21
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Hey guys
I am trying to use a BCP command on SQLSERVER 2005. I am getting some problem regarding it.
if I type the below code on command prompt
Bcp AdventureWorks.Sales.Currency out "c:\abc.txt" -c -T
Then the abc.txt is created on the C drive with all the values from that table.
but if I use my own table and write
Bcp test.dbo.tempInfo out "c:\abcd.txt" -c -T
then I will get this error SQLState = 28000, NativeError = 18456 Error = [Microsoft][SQL Native Client] [Sql server] login failed for user 'Chintamani\Chintamani'.
SQLState = 42000, NativeError = 4060 Error = [Microsoft][SQL Native Client] [Sql server] cannot open database "test" requested by the login. The login failed
Any help will be appreciated.
|
|
|
|
Chintamani
Please log in to subscribe to Chintamani's postings.
Posted on 08-09-08 1:53
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Sorry Guys
I was just a punk. I got it now.
I would clarify how I got it. I had two instances one was just Chintamani and another was Chintamani/Chintamani.
I had that AdventureWorks database on both of my instances but the test on later case.
So when I run the first BCP command it was using my first instance and executing that and similarly when I use second BCP command it was searching on my first instance and giving the error message. So I added the servername "-S Chintamani/Chintamani" on that command and now it is working.
Thank you guys for your time.
|
|
|
Brain Malfunction
Please log in to subscribe to Brain Malfunction's postings.
Posted on 08-09-08 6:42
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
ye lau.. bhanesi kuro tesopo parecha
|
|
|
Kalopoolbasi
Please log in to subscribe to Kalopoolbasi's postings.
Posted on 08-09-08 11:17
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Hi Chintamani,
I have a similar problem. I am supposed to copy the result of a query into a flat file. After looking at your problem/solution, I tried the following:
Bcp Select.....From....Where..... out "c:\abc.txt" -c -T
Then I got the error:
Msg 102, Level 15, State 1, Line 12
Incorrect syntax near 'out'.
How should I get it to work?
Thanks
Last edited: 09-Aug-08 11:17 PM
|
|