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 2000 Forums
 Transact-SQL (2000)
 BCP

Author  Topic 

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-06-16 : 01:37:51
Hello Gurus,

bcp "Northwind.sa Orders" out "c:\KK Orders.txt" -c -q -U"sa" -P"sa"

While running this script In command prompt the following error has came

SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not ex
ist or access denied.
SQLState = 01000, NativeError = 2
Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Conn
ect()).

Any Thoughts...?


Thanks
KK

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-06-16 : 01:45:19
don't you need to add -Sservername?

--------------------
keeping it simple...
Go to Top of Page

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-06-16 : 01:50:38
but in syntax i cant find the server name can u please suggest me where i have to include the servername...?

Thanks
KK
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-16 : 02:15:36
It is in the BOL
quote:
bcp Utility
The bcp utility copies data between an instance of Microsoft® SQL Server™ 2000 and a data file in a user-specified format.

Syntax
bcp {[[database_name.][owner].]{table_name | view_name} | "query"}
{in | out | queryout | format} data_file
[-m max_errors] [-f format_file] [-e err_file]
[-F first_row] [-L last_row] [-b batch_size]
[-n] [-c] [-w] [-N] [-V (60 | 65 | 70)] [-6]
[-q] [-C code_page] [-t field_term] [-r row_term]
[-i input_file] [-o output_file] [-a packet_size]
[-S server_name[\instance_name]] [-U login_id] [-P password]
[-T] [-v] [-R] [-k] [-E] [-h "hint [,...n]"]




KH

Go to Top of Page

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-06-16 : 02:17:24
Fine I will Apply

Thanks
Go to Top of Page

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-06-16 : 02:25:39
Again I faced the same problem
the Script is

bcp "Northwind.sa Orders" out "c:\KK_orders.txt" -c -q -S"indrack01"-U"sa" -P"sa"
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-06-16 : 08:33:11
Try this:

bcp "Northwind.dbo.Orders" out c:\KK_orders.txt -Sindrack01 -c -q -Usa -Psa

Don't use quotes unless absolutely needed, and make sure there is a space between parameters. Also, sa is not a user name in Northwind, all tables in Northwind are owned by dbo.
Go to Top of Page
   

- Advertisement -