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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Problem in BCP

Author  Topic 

rauk10
Starting Member

16 Posts

Posted - 2008-08-09 : 13:37:27
I am trying to use a BCP command

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 'Rauk\Rauk'.

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.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-09 : 14:22:06
Are both the databases in the same server?
Go to Top of Page

rauk10
Starting Member

16 Posts

Posted - 2008-08-09 : 14:26:26
quote:
Originally posted by visakh16

Are both the databases in the same server?



Yes they both are in the same server.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-09 : 14:37:39
and also in same instance?also do you have access to the database test?
Go to Top of Page

rauk10
Starting Member

16 Posts

Posted - 2008-08-09 : 14:58:15
quote:
Originally posted by visakh16

and also in same instance?also do you have access to the database test?



Thank You. I got it now. I was just a punk. I had two instances and on both instance I had AdventureWorks. So on the first case it was using the default instance and also searching on default instance in the second case. So I added the -S Servername on the second one and its working fine now.

Thank You for your help.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-09 : 15:01:29
quote:
Originally posted by rauk10

quote:
Originally posted by visakh16

and also in same instance?also do you have access to the database test?



Thank You. I got it now. I was just a punk. I had two instances and on both instance I had AdventureWorks. So on the first case it was using the default instance and also searching on default instance in the second case. So I added the -S Servername on the second one and its working fine now.

Thank You for your help.




cool
Go to Top of Page
   

- Advertisement -