| Erland Sommarskog 2006-03-31, 3:30 am |
| June (June@discussions.microsoft.com) writes:
> Environment: Win2000, SQL2000
> Both the command file and SQL2000 are installed on the same machine.
>
> I have a command file with the following SQL statement:
>
> bcp "SELECT * FROM [%dbname%].[dbo].[%1] WHERE DATEDIFF(hour,TimeSt
amp,
> DATEADD(n, - DATEPART(n,getdate()
), getdate())) <=24" queryout
> %CurDate%.tmp -U -P -f %formatfile%
>
> SQLState = 08001, Native Error=17
> Error=[Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does
> not exist or access denied.
>...
>
> I also tried to add parameter with -S server_name\instance
_name.
> I got similar error messages:
Can you connect to this SQL Server by other means on this machine? Is this
a named instance of the default instance?
Normally when you get this error and the server you are trying to connect
to is one the same box, it indicates that that server is not running. It's
not much a problem withg BCP per se.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
|