Showing posts with label sql7. Show all posts
Showing posts with label sql7. Show all posts

Thursday, March 22, 2012

A connection could not be established...Cannot open user default database...

Hello,
I'm running SQL7 on a Win2K server. I was in the midst of
restoring a database when I lost connectivity to the
network and the job failed.
Now if I try to view the database within Enterprise
Manager, I get the following error:
---
A connection could not be established to <servername>.
Cannot open user default database '<ID>. Using master
database instead. Please varify SQL Server is running and
check your SQL Server registration properties (by right-
clicking on the <servername> node) and try again.
---
I checked and SQL is running and the registration
properties are correct.
Any help would be appreciated.Seems like the database is "lost", as you terminated the restore, and the
logins that your EM registration login is using has that database as the
default database. I suggest you login using ISQL.EXE and change default
database using sp_defaultdb.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:0c6201c3df7b$ee9a7fe0$a101280a@.phx.gbl...
> Hello,
> I'm running SQL7 on a Win2K server. I was in the midst of
> restoring a database when I lost connectivity to the
> network and the job failed.
> Now if I try to view the database within Enterprise
> Manager, I get the following error:
> ---
> A connection could not be established to <servername>.
> Cannot open user default database '<ID>. Using master
> database instead. Please varify SQL Server is running and
> check your SQL Server registration properties (by right-
> clicking on the <servername> node) and try again.
> ---
> I checked and SQL is running and the registration
> properties are correct.
> Any help would be appreciated.
>|||Thanks Tibor - I tried that as outlined in MS KB 196076,
but I still get a the same error.(?)
>--Original Message--
>Seems like the database is "lost", as you terminated the
restore, and the
>logins that your EM registration login is using has that
database as the
>default database. I suggest you login using ISQL.EXE and
change default
>database using sp_defaultdb.
>--
>Tibor Karaszi, SQL Server MVP
>Archive at:
>http://groups.google.com/groups?
oi=djq&as_ugroup=microsoft.public.sqlserver
>
>"Jimbo" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0c6201c3df7b$ee9a7fe0$a101280a@.phx.gbl...
>> Hello,
>> I'm running SQL7 on a Win2K server. I was in the midst
of
>> restoring a database when I lost connectivity to the
>> network and the job failed.
>> Now if I try to view the database within Enterprise
>> Manager, I get the following error:
>> ---
>> A connection could not be established to <servername>.
>> Cannot open user default database '<ID>. Using master
>> database instead. Please varify SQL Server is running
and
>> check your SQL Server registration properties (by right-
>> clicking on the <servername> node) and try again.
>> ---
>> I checked and SQL is running and the registration
>> properties are correct.
>> Any help would be appreciated.
>>
>
>.
>|||Tibor Karaszi wrote:
> Seems like the database is "lost", as you terminated the restore, and the
> logins that your EM registration login is using has that database as the
> default database. I suggest you login using ISQL.EXE and change default
> database using sp_defaultdb.
>
Thanks for the information. That seems to have fixed the lost db server
issue in the drop down. Still can't get the damn app server to
connect to the db server though. Will keep searching.|||> Thanks for the information. That seems to have fixed the lost db server
> issue in the drop down. Still can't get the damn app server to connect
> to the db server though. Will keep searching.
Everyone may ignore my last post.

A connection could not be established...Cannot open user default database...

Hello,
I'm running SQL7 on a Win2K server. I was in the midst of
restoring a database when I lost connectivity to the
network and the job failed.
Now if I try to view the database within Enterprise
Manager, I get the following error:
---
A connection could not be established to <servername>.
Cannot open user default database '<ID>. Using master
database instead. Please varify SQL Server is running and
check your SQL Server registration properties (by right-
clicking on the <servername> node) and try again.
---
I checked and SQL is running and the registration
properties are correct.
Any help would be appreciated.Seems like the database is "lost", as you terminated the restore, and the
logins that your EM registration login is using has that database as the
default database. I suggest you login using ISQL.EXE and change default
database using sp_defaultdb.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:0c6201c3df7b$ee9a7fe0$a101280a@.phx.gbl...
quote:

> Hello,
> I'm running SQL7 on a Win2K server. I was in the midst of
> restoring a database when I lost connectivity to the
> network and the job failed.
> Now if I try to view the database within Enterprise
> Manager, I get the following error:
> ---
> A connection could not be established to <servername>.
> Cannot open user default database '<ID>. Using master
> database instead. Please varify SQL Server is running and
> check your SQL Server registration properties (by right-
> clicking on the <servername> node) and try again.
> ---
> I checked and SQL is running and the registration
> properties are correct.
> Any help would be appreciated.
>
|||Thanks Tibor - I tried that as outlined in MS KB 196076,
but I still get a the same error.(?)
quote:

>--Original Message--
>Seems like the database is "lost", as you terminated the

restore, and the
quote:

>logins that your EM registration login is using has that

database as the
quote:

>default database. I suggest you login using ISQL.EXE and

change default
quote:

>database using sp_defaultdb.
>--
>Tibor Karaszi, SQL Server MVP
>Archive at:
>http://groups.google.com/groups?

oi=djq&as_ugroup=microsoft.public.sqlserver
quote:

>
>"Jimbo" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:0c6201c3df7b$ee9a7fe0$a101280a@.phx.gbl...
of[QUOTE]
and[QUOTE]
>
>.
>

Monday, March 19, 2012

A .cmd file can be run on SQL7, but not on SQL2000

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!
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?
Hugo Kornelis, SQL Server MVP
|||Hi Hugo,
Thanks for your info.
1. Both the command file and SQL server are running on the same machine
(Win2000).
2. I have tried to add -S [instance_name] parameter to the command line, but
I got similar error messages:
SQLState = 08001, Native Error=17
Error=[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not
exist or access denied.
SQLState = 01000, Native Error=53
Warning=[Microsoft][ODBC SQL Server
Driver][DBNETLIB]ConnectionOpen(Connect()).
3. I also tired to replace -T with -U -P, still got the same error.
What else should I try?
Thanks again!
"Hugo Kornelis" wrote:

> On Thu, 30 Mar 2006 09:56:02 -0800, June wrote:
>
> 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?
> --
> Hugo Kornelis, SQL Server MVP
>
|||On Thu, 30 Mar 2006 14:55:01 -0800, June wrote:

>2. I have tried to add -S [instance_name] parameter to the command line, but
>I got similar error messages:
Hi June,
The correct usage of -S is either
-S server_name
or
-S server_name\instance_name

>What else should I try?
If none of these option work, try posting to a different group. This
group is actually intended for support to the "Microssoft English Query"
tool. Precious few people visit here.
Since your question is about bcp, one of the tools that come with SQL
Server, microsoft.public.sqlserver.tools would be the best place to ask.
Hugo Kornelis, SQL Server MVP