bcp error when importing data
C:>bcp dbo.[item] in 'C:\item.txt' -n -T -S"A-9"开发者_Go百科
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
Add the name of you database before dbo.[item]. YourDbName.dbo.[item]
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"
精彩评论