0
votes

C:>bcp dbo.[item] in 'C:\item.txt' -n -T -S"A-9"

i am using this command, to copy the data from item.txt file into an item table. but i get the error as:

SQLState = 37000, NativeError = 4060 Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot open databa se "dbo" requested by the login. The login failed. SQLState = 28000, NativeError = 18456 Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for u ser 'A-9\Admin'.

my host name is A-9. but i am not sure about the username.how do i get it

2

2 Answers

1
votes

Add the name of you database before dbo.[item]. YourDbName.dbo.[item]

0
votes

Try delimiting the table switch or adding the -d switch

bcp dbo.item in "C:\item.txt" -n -T -S"A-9" -d MyDB

bcp MyDB.dbo.item in "C:\item.txt" -n -T -S"A-9"