[Show all top banners]

Chintamani
Replies to this thread:

More by Chintamani
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 SQL Server Help
[VIEWED 3982 TIMES]
SAVE! for ease of future access.
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.


 
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.


 
Posted on 08-09-08 6:42 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

ye lau.. bhanesi kuro tesopo parecha


 
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

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 7 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
and it begins - on Day 1 Trump will begin operations to deport millions of undocumented immigrants
Travel Document for TPS (approved)
All the Qatar ailines from Nepal canceled to USA
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters