[quoted text, click to view] On Thu, 30 Mar 2006 09:56:02 -0800, June wrote:
>Hi,
>
>I have a command file with the following SQL statement:
>
>bcp "SELECT * FROM [%dbname%].[dbo].[%1] WHERE DATEDIFF(hour,TimeStamp,
>DATEADD(n, -DATEPART(n,getdate()), getdate())) <=24" queryout %CurDate%.tmp
>-U -P -f %formatfile%
>
>I can run this file on a machine with SQL7 installed, but have error when I
>run it on a machine with SQL2000. Here is the error:
>
>SQLState = 08001, Native Error=17
>Error=[Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not
>exist or access denied.
>
>SQLState = 01000, Native Error=2
>Warning=[Microsoft][ODBC SQL Server Driver][Shared
>Memory]ConnectionOpen(Connect()).
>
>Does anyone know where is the problem? How can I fix it?
>
>Thanks for the support!
Hi June,
Some things to check:
- Are you sure the SQL Server 2000 service is running, and that the
computer that runs this script and the server where SQL Server is
installled can "see" each other?
- Try adding the "-S servername[\instance_name]" argument
- Try using a trusted connection instead of a SQL Server login (ie
replace the "-U -P" arguments with "-T").
- If you can't use a trusted connection, double-check that SQL Server is
configured to allow "Mixed Mode Authentication". The default is "Windows
Authentication", which allows only trusted connections. Also, add userid
and password to the command string (i.e. replace "-U -P" with "-U userid
-P password").
- Check the Client Network Utility on the workstation and the Server
Network Utility on the server. Are the same protocols enabled? Are the
properties the same? If there are any firewalls between the workstation
and the server, have you made sure that the prots required for SQL
Server are not blocked?
--