I got the following after trying to connect to SQLEXPRESS
from a remote computer:
Code:
SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
1> select * from users
1> go
MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
Invalid object name 'Users'
and, after querying the tables in the DB, I find that I am in
"maser", not my intended DB. I have changed (what I thought was) the
relevant Logins to "my_db" from "master", but I still get this error.
The Logins I have changed from master to my intended database are:
"sa"
"(servername)/aspnet"
"builtin/users"
"sqlserver2005ms..."
What am i doing wrong?
Thanks!
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
-E means you login through your windows account. You need to change default database for this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegr oups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>
|||Thanks.
Even when I take out " -E " the same thing happens. I get the Master
database.
Could you (somebody) kindly tell me what I need to do to change the
default DB
to my intended DB?
Thanks again.
Tibor Karaszi wote:[vbcol=seagreen]
> -E means you login through your windows account. You need to change default database for this.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegr oups.com...
|||When you take out the -E, you are still using -E (since that is the
default).
So, you still need to set sp_defaultdb for your windows login.
Or, use SQL authentication by specifying a username and password, and set
sp_defaultdb for that login.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177092683.312878.324120@.b58g2000hsg.googlegr oups.com...
> Thanks.
> Even when I take out " -E " the same thing happens. I get the Master
> database.
> Could you (somebody) kindly tell me what I need to do to change the
> default DB
> to my intended DB?
> Thanks again.
> Tibor Karaszi wote:
>
|||> The Logins I have changed from master to my intended database are:
> "sa"
I strongly recommend you change the default database for 'sa' back to
master:
ALTER LOGIN sa
WITH DEFAULT_DATABASE = master;
Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
mentioned. Also, you can specify an alternative database context using
SQLCMD -d command-line argument rather than relying on the login's default
database:
SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegr oups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>
|||Dan -
Thank you. I appreciate your advice.
I know how to access my default database.
I didn't know the command you suggested, but
it seems to be the same as using "use MyDefaultDB"
on the command line.
The problem is, I want "MyDefaultDB" to be the default
database when I connect from VisualWebDeveloper and
right now VisualWebDeveloper is telling me that the user
doesn't exist when he tries to log on which means that
it is searching for my USERS table in the master table.
So:
> I strongly recommend you change the default database
> for 'sa' back to master:
How can I do what you are saying and allow my users to
login?
Thanks.
Dan Guzman ote-wray:[vbcol=seagreen]
> I strongly recommend you change the default database for 'sa' back to
> master:
> ALTER LOGIN sa
> WITH DEFAULT_DATABASE = master;
> Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
> mentioned. Also, you can specify an alternative database context using
> SQLCMD -d command-line argument rather than relying on the login's default
> database:
> SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegr oups.com...
|||> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
Just to be clear, are you getting the "Invalid object name 'Users'" message
in VisualWebDeveloper? Perhaps your VisualWebDeveloper connection is
specifying server or database context other than the one desired. Another
possible cause for the invalid object name error is that the object is not
in your default schema. The Best Practice is to schema-qualify object names
(e.g. SELECT * FROM dbo.Users).
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177170707.388662.126830@.b58g2000hsg.googlegr oups.com...
> Dan -
> Thank you. I appreciate your advice.
> I know how to access my default database.
> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
> So:
>
> How can I do what you are saying and allow my users to
> login?
> Thanks.
> Dan Guzman ote-wray:
>
|||> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
No, it is not. If your user has a default database of 'foo' but the user
cannot access foo, they won't have a chance to say 'use bar' because they
won't be able to log in. It depends on the tool you are using, but this is
the case in many tools...
Showing posts with label remote. Show all posts
Showing posts with label remote. Show all posts
Sunday, March 25, 2012
Default Database?
Labels:
27081gt,
computercodesqlcmd,
connect,
database,
default,
following,
microsoft,
mysql,
oracle,
remote,
select,
server,
sql,
sqlexpress,
sqlexpressfrom
Default Database?
I got the following after trying to connect to SQLEXPRESS
from a remote computer:
Code:
SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
1> select * from users
1> go
MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
Invalid object name 'Users'
and, after querying the tables in the DB, I find that I am in
"maser", not my intended DB. I have changed (what I thought was) the
relevant Logins to "my_db" from "master", but I still get this error.
The Logins I have changed from master to my intended database are:
"sa"
"(servername)/aspnet"
"builtin/users"
"sqlserver2005ms..."
What am i doing wrong?
Thanks!> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
-E means you login through your windows account. You need to change default
database for this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>|||Thanks.
Even when I take out " -E " the same thing happens. I get the Master
database.
Could you (somebody) kindly tell me what I need to do to change the
default DB
to my intended DB?
Thanks again.
Tibor Karaszi wote:[vbcol=seagreen]
> -E means you login through your windows account. You need to change defaul
t database for this.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...|||When you take out the -E, you are still using -E (since that is the
default).
So, you still need to set sp_defaultdb for your windows login.
Or, use SQL authentication by specifying a username and password, and set
sp_defaultdb for that login.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177092683.312878.324120@.b58g2000hsg.googlegroups.com...
> Thanks.
> Even when I take out " -E " the same thing happens. I get the Master
> database.
> Could you (somebody) kindly tell me what I need to do to change the
> default DB
> to my intended DB?
> Thanks again.
> Tibor Karaszi wote:
>|||> The Logins I have changed from master to my intended database are:
> "sa"
I strongly recommend you change the default database for 'sa' back to
master:
ALTER LOGIN sa
WITH DEFAULT_DATABASE = master;
Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
mentioned. Also, you can specify an alternative database context using
SQLCMD -d command-line argument rather than relying on the login's default
database:
SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>|||Dan -
Thank you. I appreciate your advice.
I know how to access my default database.
I didn't know the command you suggested, but
it seems to be the same as using "use MyDefaultDB"
on the command line.
The problem is, I want "MyDefaultDB" to be the default
database when I connect from VisualWebDeveloper and
right now VisualWebDeveloper is telling me that the user
doesn't exist when he tries to log on which means that
it is searching for my USERS table in the master table.
So:
> I strongly recommend you change the default database
> for 'sa' back to master:
How can I do what you are saying and allow my users to
login?
Thanks.
Dan Guzman ote-wray:[vbcol=seagreen]
> I strongly recommend you change the default database for 'sa' back to
> master:
> ALTER LOGIN sa
> WITH DEFAULT_DATABASE = master;
> Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
> mentioned. Also, you can specify an alternative database context using
> SQLCMD -d command-line argument rather than relying on the login's default
> database:
> SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...|||> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
Just to be clear, are you getting the "Invalid object name 'Users'" message
in VisualWebDeveloper? Perhaps your VisualWebDeveloper connection is
specifying server or database context other than the one desired. Another
possible cause for the invalid object name error is that the object is not
in your default schema. The Best Practice is to schema-qualify object names
(e.g. SELECT * FROM dbo.Users).
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177170707.388662.126830@.b58g2000hsg.googlegroups.com...
> Dan -
> Thank you. I appreciate your advice.
> I know how to access my default database.
> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
> So:
>
> How can I do what you are saying and allow my users to
> login?
> Thanks.
> Dan Guzman ote-wray:
>|||> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
No, it is not. If your user has a default database of 'foo' but the user
cannot access foo, they won't have a chance to say 'use bar' because they
won't be able to log in. It depends on the tool you are using, but this is
the case in many tools...|||Dan -
Thanks for your reply. I thought I had fixed this (hence the delay)
but the error
has returned.
> Just to be clear, are you getting the "Invalid object name 'Users'" messag
e
> in VisualWebDeveloper?
I "am" getting the "Invalid object name "Users" " error when I
try to connect using the SQLCMD. It is obvious that the command is
trying to
validate my login using the master DB and there is no Users table
there.
My connection string looks like the following:
<add name="myConnectionString" connectionString="Data
Source=192.168.0.10\SQLEXPRESS,2708;Initial Catalog=Trezoro;
Integrated Security=True; uid=sa; pwd=mypassword;"
providerName="System.Data.SqlClient"/>
I am using the 'sa' account for access and, if the 'sa' default
database is master
I am still a bit lost as to how to validate against a table that isn't
in the master DB.
> Another possible cause for the invalid object name error is that the objec
t is
> not in your default schema. The Best Practice is to schema-qualify object
names
> (e.g. SELECT * FROM dbo.Users).
When I am in the database, I can use select * from users or select *
from dbo.users - they both work.
This is taking me a while but - how do i change the default database
for when
my users login?|||> trying to
> validate my login using the master DB and there is no Users table
> there.
I think you're confusing a users table that you created with SQL Server's
internal tables for maintaining login and user information.
> This is taking me a while but - how do i change the default database
> for when
> my users login?
Take a look at sp_defaultdb in Books Online.
from a remote computer:
Code:
SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
1> select * from users
1> go
MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
Invalid object name 'Users'
and, after querying the tables in the DB, I find that I am in
"maser", not my intended DB. I have changed (what I thought was) the
relevant Logins to "my_db" from "master", but I still get this error.
The Logins I have changed from master to my intended database are:
"sa"
"(servername)/aspnet"
"builtin/users"
"sqlserver2005ms..."
What am i doing wrong?
Thanks!> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
-E means you login through your windows account. You need to change default
database for this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>|||Thanks.
Even when I take out " -E " the same thing happens. I get the Master
database.
Could you (somebody) kindly tell me what I need to do to change the
default DB
to my intended DB?
Thanks again.
Tibor Karaszi wote:[vbcol=seagreen]
> -E means you login through your windows account. You need to change defaul
t database for this.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...|||When you take out the -E, you are still using -E (since that is the
default).
So, you still need to set sp_defaultdb for your windows login.
Or, use SQL authentication by specifying a username and password, and set
sp_defaultdb for that login.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177092683.312878.324120@.b58g2000hsg.googlegroups.com...
> Thanks.
> Even when I take out " -E " the same thing happens. I get the Master
> database.
> Could you (somebody) kindly tell me what I need to do to change the
> default DB
> to my intended DB?
> Thanks again.
> Tibor Karaszi wote:
>|||> The Logins I have changed from master to my intended database are:
> "sa"
I strongly recommend you change the default database for 'sa' back to
master:
ALTER LOGIN sa
WITH DEFAULT_DATABASE = master;
Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
mentioned. Also, you can specify an alternative database context using
SQLCMD -d command-line argument rather than relying on the login's default
database:
SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>|||Dan -
Thank you. I appreciate your advice.
I know how to access my default database.
I didn't know the command you suggested, but
it seems to be the same as using "use MyDefaultDB"
on the command line.
The problem is, I want "MyDefaultDB" to be the default
database when I connect from VisualWebDeveloper and
right now VisualWebDeveloper is telling me that the user
doesn't exist when he tries to log on which means that
it is searching for my USERS table in the master table.
So:
> I strongly recommend you change the default database
> for 'sa' back to master:
How can I do what you are saying and allow my users to
login?
Thanks.
Dan Guzman ote-wray:[vbcol=seagreen]
> I strongly recommend you change the default database for 'sa' back to
> master:
> ALTER LOGIN sa
> WITH DEFAULT_DATABASE = master;
> Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
> mentioned. Also, you can specify an alternative database context using
> SQLCMD -d command-line argument rather than relying on the login's default
> database:
> SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...|||> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
Just to be clear, are you getting the "Invalid object name 'Users'" message
in VisualWebDeveloper? Perhaps your VisualWebDeveloper connection is
specifying server or database context other than the one desired. Another
possible cause for the invalid object name error is that the object is not
in your default schema. The Best Practice is to schema-qualify object names
(e.g. SELECT * FROM dbo.Users).
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177170707.388662.126830@.b58g2000hsg.googlegroups.com...
> Dan -
> Thank you. I appreciate your advice.
> I know how to access my default database.
> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
> So:
>
> How can I do what you are saying and allow my users to
> login?
> Thanks.
> Dan Guzman ote-wray:
>|||> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
No, it is not. If your user has a default database of 'foo' but the user
cannot access foo, they won't have a chance to say 'use bar' because they
won't be able to log in. It depends on the tool you are using, but this is
the case in many tools...|||Dan -
Thanks for your reply. I thought I had fixed this (hence the delay)
but the error
has returned.
> Just to be clear, are you getting the "Invalid object name 'Users'" messag
e
> in VisualWebDeveloper?
I "am" getting the "Invalid object name "Users" " error when I
try to connect using the SQLCMD. It is obvious that the command is
trying to
validate my login using the master DB and there is no Users table
there.
My connection string looks like the following:
<add name="myConnectionString" connectionString="Data
Source=192.168.0.10\SQLEXPRESS,2708;Initial Catalog=Trezoro;
Integrated Security=True; uid=sa; pwd=mypassword;"
providerName="System.Data.SqlClient"/>
I am using the 'sa' account for access and, if the 'sa' default
database is master
I am still a bit lost as to how to validate against a table that isn't
in the master DB.
> Another possible cause for the invalid object name error is that the objec
t is
> not in your default schema. The Best Practice is to schema-qualify object
names
> (e.g. SELECT * FROM dbo.Users).
When I am in the database, I can use select * from users or select *
from dbo.users - they both work.
This is taking me a while but - how do i change the default database
for when
my users login?|||> trying to
> validate my login using the master DB and there is no Users table
> there.
I think you're confusing a users table that you created with SQL Server's
internal tables for maintaining login and user information.
> This is taking me a while but - how do i change the default database
> for when
> my users login?
Take a look at sp_defaultdb in Books Online.
Labels:
27081gt,
computercodesqlcmd,
connect,
database,
default,
following,
microsoft,
mysql,
oracle,
remote,
select,
server,
sql,
sqlexpress,
sqlexpressfrom
Default Database?
I got the following after trying to connect to SQLEXPRESS
from a remote computer:
Code:
SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
1> select * from users
1> go
MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
Invalid object name 'Users'
and, after querying the tables in the DB, I find that I am in
"maser", not my intended DB. I have changed (what I thought was) the
relevant Logins to "my_db" from "master", but I still get this error.
The Logins I have changed from master to my intended database are:
"sa"
"(servername)/aspnet"
"builtin/users"
"sqlserver2005ms..."
What am i doing wrong?
Thanks!> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
-E means you login through your windows account. You need to change default database for this.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>|||Thanks.
Even when I take out " -E " the same thing happens. I get the Master
database.
Could you (somebody) kindly tell me what I need to do to change the
default DB
to my intended DB?
Thanks again.
Tibor Karaszi wote:
> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> -E means you login through your windows account. You need to change default database for this.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
> >I got the following after trying to connect to SQLEXPRESS
> > from a remote computer:
> >
> > Code:
> >
> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> > 1> select * from users
> > 1> go
> >
> > MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> > Invalid object name 'Users'
> >
> >
> >
> > and, after querying the tables in the DB, I find that I am in
> > "maser", not my intended DB. I have changed (what I thought was) the
> > relevant Logins to "my_db" from "master", but I still get this error.
> > The Logins I have changed from master to my intended database are:
> >
> > "sa"
> > "(servername)/aspnet"
> > "builtin/users"
> > "sqlserver2005ms..."
> >
> > What am i doing wrong?
> > Thanks!
> >|||When you take out the -E, you are still using -E (since that is the
default).
So, you still need to set sp_defaultdb for your windows login.
Or, use SQL authentication by specifying a username and password, and set
sp_defaultdb for that login.
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177092683.312878.324120@.b58g2000hsg.googlegroups.com...
> Thanks.
> Even when I take out " -E " the same thing happens. I get the Master
> database.
> Could you (somebody) kindly tell me what I need to do to change the
> default DB
> to my intended DB?
> Thanks again.
> Tibor Karaszi wote:
>> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
>> -E means you login through your windows account. You need to change
>> default database for this.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "pbd22" <dushkin@.gmail.com> wrote in message
>> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>> >I got the following after trying to connect to SQLEXPRESS
>> > from a remote computer:
>> >
>> > Code:
>> >
>> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
>> > 1> select * from users
>> > 1> go
>> >
>> > MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
>> > Invalid object name 'Users'
>> >
>> >
>> >
>> > and, after querying the tables in the DB, I find that I am in
>> > "maser", not my intended DB. I have changed (what I thought was) the
>> > relevant Logins to "my_db" from "master", but I still get this error.
>> > The Logins I have changed from master to my intended database are:
>> >
>> > "sa"
>> > "(servername)/aspnet"
>> > "builtin/users"
>> > "sqlserver2005ms..."
>> >
>> > What am i doing wrong?
>> > Thanks!
>> >
>|||> The Logins I have changed from master to my intended database are:
> "sa"
I strongly recommend you change the default database for 'sa' back to
master:
ALTER LOGIN sa
WITH DEFAULT_DATABASE = master;
Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
mentioned. Also, you can specify an alternative database context using
SQLCMD -d command-line argument rather than relying on the login's default
database:
SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
--
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>|||Dan -
Thank you. I appreciate your advice.
I know how to access my default database.
I didn't know the command you suggested, but
it seems to be the same as using "use MyDefaultDB"
on the command line.
The problem is, I want "MyDefaultDB" to be the default
database when I connect from VisualWebDeveloper and
right now VisualWebDeveloper is telling me that the user
doesn't exist when he tries to log on which means that
it is searching for my USERS table in the master table.
So:
> I strongly recommend you change the default database
> for 'sa' back to master:
How can I do what you are saying and allow my users to
login?
Thanks.
Dan Guzman ote-wray:
> > The Logins I have changed from master to my intended database are:
> >
> > "sa"
> I strongly recommend you change the default database for 'sa' back to
> master:
> ALTER LOGIN sa
> WITH DEFAULT_DATABASE = master;
> Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
> mentioned. Also, you can specify an alternative database context using
> SQLCMD -d command-line argument rather than relying on the login's default
> database:
> SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
> >I got the following after trying to connect to SQLEXPRESS
> > from a remote computer:
> >
> > Code:
> >
> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> > 1> select * from users
> > 1> go
> >
> > MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> > Invalid object name 'Users'
> >
> >
> >
> > and, after querying the tables in the DB, I find that I am in
> > "maser", not my intended DB. I have changed (what I thought was) the
> > relevant Logins to "my_db" from "master", but I still get this error.
> > The Logins I have changed from master to my intended database are:
> >
> > "sa"
> > "(servername)/aspnet"
> > "builtin/users"
> > "sqlserver2005ms..."
> >
> > What am i doing wrong?
> > Thanks!
> >|||> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
Just to be clear, are you getting the "Invalid object name 'Users'" message
in VisualWebDeveloper? Perhaps your VisualWebDeveloper connection is
specifying server or database context other than the one desired. Another
possible cause for the invalid object name error is that the object is not
in your default schema. The Best Practice is to schema-qualify object names
(e.g. SELECT * FROM dbo.Users).
--
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177170707.388662.126830@.b58g2000hsg.googlegroups.com...
> Dan -
> Thank you. I appreciate your advice.
> I know how to access my default database.
> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
> So:
>> I strongly recommend you change the default database
>> for 'sa' back to master:
> How can I do what you are saying and allow my users to
> login?
> Thanks.
> Dan Guzman ote-wray:
>> > The Logins I have changed from master to my intended database are:
>> >
>> > "sa"
>> I strongly recommend you change the default database for 'sa' back to
>> master:
>> ALTER LOGIN sa
>> WITH DEFAULT_DATABASE = master;
>> Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
>> mentioned. Also, you can specify an alternative database context using
>> SQLCMD -d command-line argument rather than relying on the login's
>> default
>> database:
>> SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "pbd22" <dushkin@.gmail.com> wrote in message
>> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>> >I got the following after trying to connect to SQLEXPRESS
>> > from a remote computer:
>> >
>> > Code:
>> >
>> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
>> > 1> select * from users
>> > 1> go
>> >
>> > MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
>> > Invalid object name 'Users'
>> >
>> >
>> >
>> > and, after querying the tables in the DB, I find that I am in
>> > "maser", not my intended DB. I have changed (what I thought was) the
>> > relevant Logins to "my_db" from "master", but I still get this error.
>> > The Logins I have changed from master to my intended database are:
>> >
>> > "sa"
>> > "(servername)/aspnet"
>> > "builtin/users"
>> > "sqlserver2005ms..."
>> >
>> > What am i doing wrong?
>> > Thanks!
>> >
>|||> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
No, it is not. If your user has a default database of 'foo' but the user
cannot access foo, they won't have a chance to say 'use bar' because they
won't be able to log in. It depends on the tool you are using, but this is
the case in many tools...|||Dan -
Thanks for your reply. I thought I had fixed this (hence the delay)
but the error
has returned.
> Just to be clear, are you getting the "Invalid object name 'Users'" message
> in VisualWebDeveloper?
I "am" getting the "Invalid object name "Users" " error when I
try to connect using the SQLCMD. It is obvious that the command is
trying to
validate my login using the master DB and there is no Users table
there.
My connection string looks like the following:
<add name="myConnectionString" connectionString="Data
Source=192.168.0.10\SQLEXPRESS,2708;Initial Catalog=Trezoro;
Integrated Security=True; uid=sa; pwd=mypassword;"
providerName="System.Data.SqlClient"/>
I am using the 'sa' account for access and, if the 'sa' default
database is master
I am still a bit lost as to how to validate against a table that isn't
in the master DB.
> Another possible cause for the invalid object name error is that the object is
> not in your default schema. The Best Practice is to schema-qualify object
names
> (e.g. SELECT * FROM dbo.Users).
When I am in the database, I can use select * from users or select *
from dbo.users - they both work.
This is taking me a while but - how do i change the default database
for when
my users login?|||> trying to
> validate my login using the master DB and there is no Users table
> there.
I think you're confusing a users table that you created with SQL Server's
internal tables for maintaining login and user information.
> This is taking me a while but - how do i change the default database
> for when
> my users login?
Take a look at sp_defaultdb in Books Online.|||> This is taking me a while but - how do i change the default database
> for when
> my users login?
As Aaron mentioned, you can specify the default database for a login with
sp_default_db. Since you are using SQL 2005, you can alternatively use DCL:
ALTER LOGIN MyLogin
WITH DEFAULT_DATABASE = MyLogin;
However, the login's default database is used only if you do not specify a
database context when connecting. Try this, which I would expect this to
succeed as long as your Windows account has access to the Trezoro database:
SQLCMD -E -S -d Trezoro 192.168.0.10\SQLEXPRESS,2708 - Q"SELECT * FROM
dbo.users"
GO
If the above failes with error "invalid object name dbo.users", run the
following to verify database and user context:
SQLCMD -E -S -d Trezoro 192.168.0.10\SQLEXPRESS,2708 - Q"SELECT DB_NAME(),
USER"
If the database and user are as expected, verify the table actually exists:
SQLCMD -E -S -d Trezoro 192.168.0.10\SQLEXPRESS,2708 - Q"SELECT name FROM
sys.tables WHERE name = 'users'"
> <add name="myConnectionString" connectionString="Data
> Source=192.168.0.10\SQLEXPRESS,2708;Initial Catalog=Trezoro;
> Integrated Security=True; uid=sa; pwd=mypassword;"
> providerName="System.Data.SqlClient"/>
> I am using the 'sa' account for access and, if the 'sa' default
> database is master
> I am still a bit lost as to how to validate against a table that isn't
> in the master DB.
Because you specified 'Integrated Security=True' in the connection string,
the user and password specification are ignored. The connection is instead
done under the context of a Windows account. I'm not an web guy but I
believe your Windows account is used when you run from the IDE. This
doesn't explain why you would get the invalid object error, though. I would
first troubleshoot the problem with SQLCMD before you try the application.
In any case, you should never use 'sa' for routine development or
application access.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177879467.944332.115100@.n59g2000hsh.googlegroups.com...
> Dan -
> Thanks for your reply. I thought I had fixed this (hence the delay)
> but the error
> has returned.
>> Just to be clear, are you getting the "Invalid object name 'Users'"
>> message
>> in VisualWebDeveloper?
> I "am" getting the "Invalid object name "Users" " error when I
> try to connect using the SQLCMD. It is obvious that the command is
> trying to
> validate my login using the master DB and there is no Users table
> there.
> My connection string looks like the following:
> <add name="myConnectionString" connectionString="Data
> Source=192.168.0.10\SQLEXPRESS,2708;Initial Catalog=Trezoro;
> Integrated Security=True; uid=sa; pwd=mypassword;"
> providerName="System.Data.SqlClient"/>
> I am using the 'sa' account for access and, if the 'sa' default
> database is master
> I am still a bit lost as to how to validate against a table that isn't
> in the master DB.
>> Another possible cause for the invalid object name error is that the
>> object is
>> not in your default schema. The Best Practice is to schema-qualify
>> object
> names
>> (e.g. SELECT * FROM dbo.Users).
> When I am in the database, I can use select * from users or select *
> from dbo.users - they both work.
> This is taking me a while but - how do i change the default database
> for when
> my users login?
>sql
from a remote computer:
Code:
SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
1> select * from users
1> go
MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
Invalid object name 'Users'
and, after querying the tables in the DB, I find that I am in
"maser", not my intended DB. I have changed (what I thought was) the
relevant Logins to "my_db" from "master", but I still get this error.
The Logins I have changed from master to my intended database are:
"sa"
"(servername)/aspnet"
"builtin/users"
"sqlserver2005ms..."
What am i doing wrong?
Thanks!> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
-E means you login through your windows account. You need to change default database for this.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>|||Thanks.
Even when I take out " -E " the same thing happens. I get the Master
database.
Could you (somebody) kindly tell me what I need to do to change the
default DB
to my intended DB?
Thanks again.
Tibor Karaszi wote:
> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> -E means you login through your windows account. You need to change default database for this.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
> >I got the following after trying to connect to SQLEXPRESS
> > from a remote computer:
> >
> > Code:
> >
> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> > 1> select * from users
> > 1> go
> >
> > MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> > Invalid object name 'Users'
> >
> >
> >
> > and, after querying the tables in the DB, I find that I am in
> > "maser", not my intended DB. I have changed (what I thought was) the
> > relevant Logins to "my_db" from "master", but I still get this error.
> > The Logins I have changed from master to my intended database are:
> >
> > "sa"
> > "(servername)/aspnet"
> > "builtin/users"
> > "sqlserver2005ms..."
> >
> > What am i doing wrong?
> > Thanks!
> >|||When you take out the -E, you are still using -E (since that is the
default).
So, you still need to set sp_defaultdb for your windows login.
Or, use SQL authentication by specifying a username and password, and set
sp_defaultdb for that login.
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177092683.312878.324120@.b58g2000hsg.googlegroups.com...
> Thanks.
> Even when I take out " -E " the same thing happens. I get the Master
> database.
> Could you (somebody) kindly tell me what I need to do to change the
> default DB
> to my intended DB?
> Thanks again.
> Tibor Karaszi wote:
>> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
>> -E means you login through your windows account. You need to change
>> default database for this.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "pbd22" <dushkin@.gmail.com> wrote in message
>> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>> >I got the following after trying to connect to SQLEXPRESS
>> > from a remote computer:
>> >
>> > Code:
>> >
>> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
>> > 1> select * from users
>> > 1> go
>> >
>> > MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
>> > Invalid object name 'Users'
>> >
>> >
>> >
>> > and, after querying the tables in the DB, I find that I am in
>> > "maser", not my intended DB. I have changed (what I thought was) the
>> > relevant Logins to "my_db" from "master", but I still get this error.
>> > The Logins I have changed from master to my intended database are:
>> >
>> > "sa"
>> > "(servername)/aspnet"
>> > "builtin/users"
>> > "sqlserver2005ms..."
>> >
>> > What am i doing wrong?
>> > Thanks!
>> >
>|||> The Logins I have changed from master to my intended database are:
> "sa"
I strongly recommend you change the default database for 'sa' back to
master:
ALTER LOGIN sa
WITH DEFAULT_DATABASE = master;
Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
mentioned. Also, you can specify an alternative database context using
SQLCMD -d command-line argument rather than relying on the login's default
database:
SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
--
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>I got the following after trying to connect to SQLEXPRESS
> from a remote computer:
> Code:
> SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> 1> select * from users
> 1> go
> MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> Invalid object name 'Users'
>
> and, after querying the tables in the DB, I find that I am in
> "maser", not my intended DB. I have changed (what I thought was) the
> relevant Logins to "my_db" from "master", but I still get this error.
> The Logins I have changed from master to my intended database are:
> "sa"
> "(servername)/aspnet"
> "builtin/users"
> "sqlserver2005ms..."
> What am i doing wrong?
> Thanks!
>|||Dan -
Thank you. I appreciate your advice.
I know how to access my default database.
I didn't know the command you suggested, but
it seems to be the same as using "use MyDefaultDB"
on the command line.
The problem is, I want "MyDefaultDB" to be the default
database when I connect from VisualWebDeveloper and
right now VisualWebDeveloper is telling me that the user
doesn't exist when he tries to log on which means that
it is searching for my USERS table in the master table.
So:
> I strongly recommend you change the default database
> for 'sa' back to master:
How can I do what you are saying and allow my users to
login?
Thanks.
Dan Guzman ote-wray:
> > The Logins I have changed from master to my intended database are:
> >
> > "sa"
> I strongly recommend you change the default database for 'sa' back to
> master:
> ALTER LOGIN sa
> WITH DEFAULT_DATABASE = master;
> Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
> mentioned. Also, you can specify an alternative database context using
> SQLCMD -d command-line argument rather than relying on the login's default
> database:
> SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "pbd22" <dushkin@.gmail.com> wrote in message
> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
> >I got the following after trying to connect to SQLEXPRESS
> > from a remote computer:
> >
> > Code:
> >
> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
> > 1> select * from users
> > 1> go
> >
> > MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
> > Invalid object name 'Users'
> >
> >
> >
> > and, after querying the tables in the DB, I find that I am in
> > "maser", not my intended DB. I have changed (what I thought was) the
> > relevant Logins to "my_db" from "master", but I still get this error.
> > The Logins I have changed from master to my intended database are:
> >
> > "sa"
> > "(servername)/aspnet"
> > "builtin/users"
> > "sqlserver2005ms..."
> >
> > What am i doing wrong?
> > Thanks!
> >|||> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
Just to be clear, are you getting the "Invalid object name 'Users'" message
in VisualWebDeveloper? Perhaps your VisualWebDeveloper connection is
specifying server or database context other than the one desired. Another
possible cause for the invalid object name error is that the object is not
in your default schema. The Best Practice is to schema-qualify object names
(e.g. SELECT * FROM dbo.Users).
--
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177170707.388662.126830@.b58g2000hsg.googlegroups.com...
> Dan -
> Thank you. I appreciate your advice.
> I know how to access my default database.
> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
> The problem is, I want "MyDefaultDB" to be the default
> database when I connect from VisualWebDeveloper and
> right now VisualWebDeveloper is telling me that the user
> doesn't exist when he tries to log on which means that
> it is searching for my USERS table in the master table.
> So:
>> I strongly recommend you change the default database
>> for 'sa' back to master:
> How can I do what you are saying and allow my users to
> login?
> Thanks.
> Dan Guzman ote-wray:
>> > The Logins I have changed from master to my intended database are:
>> >
>> > "sa"
>> I strongly recommend you change the default database for 'sa' back to
>> master:
>> ALTER LOGIN sa
>> WITH DEFAULT_DATABASE = master;
>> Note that ALTER LOGIN is an alternative to the sp_defaultdb method Aaron
>> mentioned. Also, you can specify an alternative database context using
>> SQLCMD -d command-line argument rather than relying on the login's
>> default
>> database:
>> SQLCMD -d MyDatabase -E -S 192.168.0.10\SQLEXPRESS,2708
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "pbd22" <dushkin@.gmail.com> wrote in message
>> news:1177086809.684832.131880@.d57g2000hsg.googlegroups.com...
>> >I got the following after trying to connect to SQLEXPRESS
>> > from a remote computer:
>> >
>> > Code:
>> >
>> > SQLCMD -E -S 192.168.0.10\SQLEXPRESS,2708
>> > 1> select * from users
>> > 1> go
>> >
>> > MSG 208, Level 16, State 1, Server DISNYLAND\SQLEXPRESS, Line 1
>> > Invalid object name 'Users'
>> >
>> >
>> >
>> > and, after querying the tables in the DB, I find that I am in
>> > "maser", not my intended DB. I have changed (what I thought was) the
>> > relevant Logins to "my_db" from "master", but I still get this error.
>> > The Logins I have changed from master to my intended database are:
>> >
>> > "sa"
>> > "(servername)/aspnet"
>> > "builtin/users"
>> > "sqlserver2005ms..."
>> >
>> > What am i doing wrong?
>> > Thanks!
>> >
>|||> I didn't know the command you suggested, but
> it seems to be the same as using "use MyDefaultDB"
> on the command line.
No, it is not. If your user has a default database of 'foo' but the user
cannot access foo, they won't have a chance to say 'use bar' because they
won't be able to log in. It depends on the tool you are using, but this is
the case in many tools...|||Dan -
Thanks for your reply. I thought I had fixed this (hence the delay)
but the error
has returned.
> Just to be clear, are you getting the "Invalid object name 'Users'" message
> in VisualWebDeveloper?
I "am" getting the "Invalid object name "Users" " error when I
try to connect using the SQLCMD. It is obvious that the command is
trying to
validate my login using the master DB and there is no Users table
there.
My connection string looks like the following:
<add name="myConnectionString" connectionString="Data
Source=192.168.0.10\SQLEXPRESS,2708;Initial Catalog=Trezoro;
Integrated Security=True; uid=sa; pwd=mypassword;"
providerName="System.Data.SqlClient"/>
I am using the 'sa' account for access and, if the 'sa' default
database is master
I am still a bit lost as to how to validate against a table that isn't
in the master DB.
> Another possible cause for the invalid object name error is that the object is
> not in your default schema. The Best Practice is to schema-qualify object
names
> (e.g. SELECT * FROM dbo.Users).
When I am in the database, I can use select * from users or select *
from dbo.users - they both work.
This is taking me a while but - how do i change the default database
for when
my users login?|||> trying to
> validate my login using the master DB and there is no Users table
> there.
I think you're confusing a users table that you created with SQL Server's
internal tables for maintaining login and user information.
> This is taking me a while but - how do i change the default database
> for when
> my users login?
Take a look at sp_defaultdb in Books Online.|||> This is taking me a while but - how do i change the default database
> for when
> my users login?
As Aaron mentioned, you can specify the default database for a login with
sp_default_db. Since you are using SQL 2005, you can alternatively use DCL:
ALTER LOGIN MyLogin
WITH DEFAULT_DATABASE = MyLogin;
However, the login's default database is used only if you do not specify a
database context when connecting. Try this, which I would expect this to
succeed as long as your Windows account has access to the Trezoro database:
SQLCMD -E -S -d Trezoro 192.168.0.10\SQLEXPRESS,2708 - Q"SELECT * FROM
dbo.users"
GO
If the above failes with error "invalid object name dbo.users", run the
following to verify database and user context:
SQLCMD -E -S -d Trezoro 192.168.0.10\SQLEXPRESS,2708 - Q"SELECT DB_NAME(),
USER"
If the database and user are as expected, verify the table actually exists:
SQLCMD -E -S -d Trezoro 192.168.0.10\SQLEXPRESS,2708 - Q"SELECT name FROM
sys.tables WHERE name = 'users'"
> <add name="myConnectionString" connectionString="Data
> Source=192.168.0.10\SQLEXPRESS,2708;Initial Catalog=Trezoro;
> Integrated Security=True; uid=sa; pwd=mypassword;"
> providerName="System.Data.SqlClient"/>
> I am using the 'sa' account for access and, if the 'sa' default
> database is master
> I am still a bit lost as to how to validate against a table that isn't
> in the master DB.
Because you specified 'Integrated Security=True' in the connection string,
the user and password specification are ignored. The connection is instead
done under the context of a Windows account. I'm not an web guy but I
believe your Windows account is used when you run from the IDE. This
doesn't explain why you would get the invalid object error, though. I would
first troubleshoot the problem with SQLCMD before you try the application.
In any case, you should never use 'sa' for routine development or
application access.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"pbd22" <dushkin@.gmail.com> wrote in message
news:1177879467.944332.115100@.n59g2000hsh.googlegroups.com...
> Dan -
> Thanks for your reply. I thought I had fixed this (hence the delay)
> but the error
> has returned.
>> Just to be clear, are you getting the "Invalid object name 'Users'"
>> message
>> in VisualWebDeveloper?
> I "am" getting the "Invalid object name "Users" " error when I
> try to connect using the SQLCMD. It is obvious that the command is
> trying to
> validate my login using the master DB and there is no Users table
> there.
> My connection string looks like the following:
> <add name="myConnectionString" connectionString="Data
> Source=192.168.0.10\SQLEXPRESS,2708;Initial Catalog=Trezoro;
> Integrated Security=True; uid=sa; pwd=mypassword;"
> providerName="System.Data.SqlClient"/>
> I am using the 'sa' account for access and, if the 'sa' default
> database is master
> I am still a bit lost as to how to validate against a table that isn't
> in the master DB.
>> Another possible cause for the invalid object name error is that the
>> object is
>> not in your default schema. The Best Practice is to schema-qualify
>> object
> names
>> (e.g. SELECT * FROM dbo.Users).
> When I am in the database, I can use select * from users or select *
> from dbo.users - they both work.
> This is taking me a while but - how do i change the default database
> for when
> my users login?
>sql
Thursday, March 22, 2012
Default Database
I am using SQL Server Management to access a remote SQL Server. That server
has many databases but I have rights to only one so I set that as the
default database. In the connection properties it shows the correct database
but when I open the connection to that server I get the list of all the
databases instead of just the one I set as default? How can I get it to open
(show) just that one database?
have a look in BooksOnLine for
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/toolref9/html/469ea8e2-79b9-44c8-bb6f-f0e1c5dbf0f2.htm
Andrew J. Kelly SQL MVP
"Wayne" <wayneNoSpam@.hotmail.com> wrote in message
news:%23QC2YWnQHHA.4276@.TK2MSFTNGP02.phx.gbl...
>I am using SQL Server Management to access a remote SQL Server. That server
> has many databases but I have rights to only one so I set that as the
> default database. In the connection properties it shows the correct
> database
> but when I open the connection to that server I get the list of all the
> databases instead of just the one I set as default? How can I get it to
> open
> (show) just that one database?
>
|||Andrew;
Thanls for your response. I tried that link as a search argument in BOL but
it was not found? Is there another way I should locate it?
Wayne
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23DjWvrnQHHA.3592@.TK2MSFTNGP06.phx.gbl...
> have a look in BooksOnLine for
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/toolref9/html/469ea8e2-79b9-44c8-bb6f-f0e1c5dbf0f2.htm
>
> --
> Andrew J. Kelly SQL MVP
> "Wayne" <wayneNoSpam@.hotmail.com> wrote in message
> news:%23QC2YWnQHHA.4276@.TK2MSFTNGP02.phx.gbl...
>
|||Andrew;
Thanks for the response. When I entered that as a Search in BOL it was not
found? Is there another way I can locate that?
Wayne
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23DjWvrnQHHA.3592@.TK2MSFTNGP06.phx.gbl...
> have a look in BooksOnLine for
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/toolref9/html/469ea8e2-79b9-44c8-bb6f-f0e1c5dbf0f2.htm
>
> --
> Andrew J. Kelly SQL MVP
> "Wayne" <wayneNoSpam@.hotmail.com> wrote in message
> news:%23QC2YWnQHHA.4276@.TK2MSFTNGP02.phx.gbl...
>
|||Thanks... that worked.
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:523hi4F1mjp3rU1@.mid.individual.net...
> hi Wayne,
> Wayne wrote:
> paste the Url Andrew provided in the "Url:" box in the right pane of the
> BOL, near the "search" combo.. or just have a look at
> http://msdn2.microsoft.com/en-us/library/ms173849.aspx
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz http://italy.mvps.org
> DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
> -- remove DMO to reply
>
has many databases but I have rights to only one so I set that as the
default database. In the connection properties it shows the correct database
but when I open the connection to that server I get the list of all the
databases instead of just the one I set as default? How can I get it to open
(show) just that one database?
have a look in BooksOnLine for
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/toolref9/html/469ea8e2-79b9-44c8-bb6f-f0e1c5dbf0f2.htm
Andrew J. Kelly SQL MVP
"Wayne" <wayneNoSpam@.hotmail.com> wrote in message
news:%23QC2YWnQHHA.4276@.TK2MSFTNGP02.phx.gbl...
>I am using SQL Server Management to access a remote SQL Server. That server
> has many databases but I have rights to only one so I set that as the
> default database. In the connection properties it shows the correct
> database
> but when I open the connection to that server I get the list of all the
> databases instead of just the one I set as default? How can I get it to
> open
> (show) just that one database?
>
|||Andrew;
Thanls for your response. I tried that link as a search argument in BOL but
it was not found? Is there another way I should locate it?
Wayne
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23DjWvrnQHHA.3592@.TK2MSFTNGP06.phx.gbl...
> have a look in BooksOnLine for
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/toolref9/html/469ea8e2-79b9-44c8-bb6f-f0e1c5dbf0f2.htm
>
> --
> Andrew J. Kelly SQL MVP
> "Wayne" <wayneNoSpam@.hotmail.com> wrote in message
> news:%23QC2YWnQHHA.4276@.TK2MSFTNGP02.phx.gbl...
>
|||Andrew;
Thanks for the response. When I entered that as a Search in BOL it was not
found? Is there another way I can locate that?
Wayne
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23DjWvrnQHHA.3592@.TK2MSFTNGP06.phx.gbl...
> have a look in BooksOnLine for
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/toolref9/html/469ea8e2-79b9-44c8-bb6f-f0e1c5dbf0f2.htm
>
> --
> Andrew J. Kelly SQL MVP
> "Wayne" <wayneNoSpam@.hotmail.com> wrote in message
> news:%23QC2YWnQHHA.4276@.TK2MSFTNGP02.phx.gbl...
>
|||Thanks... that worked.
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:523hi4F1mjp3rU1@.mid.individual.net...
> hi Wayne,
> Wayne wrote:
> paste the Url Andrew provided in the "Url:" box in the right pane of the
> BOL, near the "search" combo.. or just have a look at
> http://msdn2.microsoft.com/en-us/library/ms173849.aspx
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz http://italy.mvps.org
> DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
> -- remove DMO to reply
>
Friday, February 17, 2012
Debugger on remote machine
Looks like a permission issue. Check the permission of the
user connecting locally vs the user connecting remotely.
This might give you some clue.
HTH.
Obaid.
>--Original Message--
>We have a remote server (w 2000, sql 2000) where we can
debug stored procedures locally but cannot debug stored
procedures remotely. Has anyone encountered this?
>.
>It's the same user.
What I'm noticing is that when debugging is done localy, the debugger pause
s on the first line. All of the debugging icons are active. In profler ther
e are two calls to sp_sdidebug (the first passes a 'check', parm the second
passes an 'on' parm) and s
et implicit transactions statement. If you then press F5 the code executes.
In profiler the procedure is executed and then there is a call to sp_sdide
bug (passes an 'off' parm).
When debugging locally, the code appears to immediately execute and the debu
gging icons are grayed out. This is confirmed in profiler where there are t
he two calls to sp_sdidebug, the procedure is executed and there is the call
to sp_sdidebug with the of
f parameter. So the code appears to execute immediately rather than being pa
used, and the debugger is disabled.|||KB article 328151 had the solution to our problem. The T-SQL Debugger is tu
rned off for non-sp3 clients after you install sp3. We're having our develo
pers upgrade their client tools to sp3. You can also run sp_sdidebug 'legacy
_on' each time you reboot t
he server.
user connecting locally vs the user connecting remotely.
This might give you some clue.
HTH.
Obaid.
>--Original Message--
>We have a remote server (w 2000, sql 2000) where we can
debug stored procedures locally but cannot debug stored
procedures remotely. Has anyone encountered this?
>.
>It's the same user.
What I'm noticing is that when debugging is done localy, the debugger pause
s on the first line. All of the debugging icons are active. In profler ther
e are two calls to sp_sdidebug (the first passes a 'check', parm the second
passes an 'on' parm) and s
et implicit transactions statement. If you then press F5 the code executes.
In profiler the procedure is executed and then there is a call to sp_sdide
bug (passes an 'off' parm).
When debugging locally, the code appears to immediately execute and the debu
gging icons are grayed out. This is confirmed in profiler where there are t
he two calls to sp_sdidebug, the procedure is executed and there is the call
to sp_sdidebug with the of
f parameter. So the code appears to execute immediately rather than being pa
used, and the debugger is disabled.|||KB article 328151 had the solution to our problem. The T-SQL Debugger is tu
rned off for non-sp3 clients after you install sp3. We're having our develo
pers upgrade their client tools to sp3. You can also run sp_sdidebug 'legacy
_on' each time you reboot t
he server.
Debugger on remote machine
Looks like a permission issue. Check the permission of the
user connecting locally vs the user connecting remotely.
This might give you some clue.
HTH.
Obaid.
>--Original Message--
>We have a remote server (w 2000, sql 2000) where we can
debug stored procedures locally but cannot debug stored
procedures remotely. Has anyone encountered this?
>.
>
It's the same user.
What I'm noticing is that when debugging is done localy, the debugger pauses on the first line. All of the debugging icons are active. In profler there are two calls to sp_sdidebug (the first passes a 'check', parm the second passes an 'on' parm) and s
et implicit transactions statement. If you then press F5 the code executes. In profiler the procedure is executed and then there is a call to sp_sdidebug (passes an 'off' parm).
When debugging locally, the code appears to immediately execute and the debugging icons are grayed out. This is confirmed in profiler where there are the two calls to sp_sdidebug, the procedure is executed and there is the call to sp_sdidebug with the of
f parameter. So the code appears to execute immediately rather than being paused, and the debugger is disabled.
user connecting locally vs the user connecting remotely.
This might give you some clue.
HTH.
Obaid.
>--Original Message--
>We have a remote server (w 2000, sql 2000) where we can
debug stored procedures locally but cannot debug stored
procedures remotely. Has anyone encountered this?
>.
>
It's the same user.
What I'm noticing is that when debugging is done localy, the debugger pauses on the first line. All of the debugging icons are active. In profler there are two calls to sp_sdidebug (the first passes a 'check', parm the second passes an 'on' parm) and s
et implicit transactions statement. If you then press F5 the code executes. In profiler the procedure is executed and then there is a call to sp_sdidebug (passes an 'off' parm).
When debugging locally, the code appears to immediately execute and the debugging icons are grayed out. This is confirmed in profiler where there are the two calls to sp_sdidebug, the procedure is executed and there is the call to sp_sdidebug with the of
f parameter. So the code appears to execute immediately rather than being paused, and the debugger is disabled.
debugger
Hello,
I got the following error message when I was trying to debug a stored
procedure sitting on a remote sql database server. I have no problem
running the debugger on the local server. It just don't work if I try to
debug a stored procedure on a different server. Here is the error message I
got from query analyzer:
Server: Msg 504, Level 16, State 1, Procedure sp_sdidebug, Line 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Unable to connect to debugger
on QAIMGSQL01 (Error = 0x80070005). Ensure that client-side components, such
as SQLDBREG.EXE, are installed and registered on DVO-D1. Debugging disabled
for connection 74.
Any input is highly appreciated.
Thanks,
LianneLianne Kwock (LianneKwock@.discussions.microsoft.com) writes:
> I got the following error message when I was trying to debug a stored
> procedure sitting on a remote sql database server. I have no problem
> running the debugger on the local server. It just don't work if I try
> to debug a stored procedure on a different server. Here is the error
> message I got from query analyzer: >
> Server: Msg 504, Level 16, State 1, Procedure sp_sdidebug, Line 1
> [Microsoft][ODBC SQL Server Driver][SQL Server]Unable to connect to
> debugger on QAIMGSQL01 (Error = 0x80070005). Ensure that client-side
> components, such as SQLDBREG.EXE, are installed and registered on
> DVO-D1. Debugging disabled for connection 74.
Which version do you have of the client tools? (Visible under Help->About)
Which version is the remote SQL Server? (SELECT @.@.version)
Are you running Windows XP SP2, and have the firewall enabled?
If you XP SP2 with the firewall, both the client tools and the server
needs to be on Service Pack4 for SQL 2000. Futhermore, you need to
configure the firewall, so that SQL Server can access port 135 (RPC) on
your machine. Click the Windows Firewall applet in the Control Panel,
and go the Exceptions tab and select Add Port. In this dialog, be sure
to use Change Scope to open the port only for the SQL Server machine.
And when you've done all this, you may find that it still does not
work. I had i working at the office for a while when we had gotten
hotfix 8.00.944, a pre-SP4 fix. Then our sy
min changed something;
I think the priveleges of the service account for SQL Server. I have
since then given up on SQL debugging. It is just too much hassle.
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|||I too had similar problems, and essentially, like Erland mentioned, gave up
on remote debugging. Debugging can be handy, so when I really need it, I
actually copy the database locally, so I can debug.
Jef
"Lianne Kwock" <LianneKwock@.discussions.microsoft.com> wrote in message
news:2909E993-E2FA-4F4E-863F-39F95A97F987@.microsoft.com...
> Hello,
> I got the following error message when I was trying to debug a stored
> procedure sitting on a remote sql database server. I have no problem
> running the debugger on the local server. It just don't work if I try to
> debug a stored procedure on a different server. Here is the error message
> I
> got from query analyzer:
>
> Server: Msg 504, Level 16, State 1, Procedure sp_sdidebug, Line 1
> [Microsoft][ODBC SQL Server Driver][SQL Server]Unable to connect to
> debugger
> on QAIMGSQL01 (Error = 0x80070005). Ensure that client-side components,
> such
> as SQLDBREG.EXE, are installed and registered on DVO-D1. Debugging
> disabled
> for connection 74.
>
> Any input is highly appreciated.
>
> Thanks,
> Lianne
>
I got the following error message when I was trying to debug a stored
procedure sitting on a remote sql database server. I have no problem
running the debugger on the local server. It just don't work if I try to
debug a stored procedure on a different server. Here is the error message I
got from query analyzer:
Server: Msg 504, Level 16, State 1, Procedure sp_sdidebug, Line 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Unable to connect to debugger
on QAIMGSQL01 (Error = 0x80070005). Ensure that client-side components, such
as SQLDBREG.EXE, are installed and registered on DVO-D1. Debugging disabled
for connection 74.
Any input is highly appreciated.
Thanks,
LianneLianne Kwock (LianneKwock@.discussions.microsoft.com) writes:
> I got the following error message when I was trying to debug a stored
> procedure sitting on a remote sql database server. I have no problem
> running the debugger on the local server. It just don't work if I try
> to debug a stored procedure on a different server. Here is the error
> message I got from query analyzer: >
> Server: Msg 504, Level 16, State 1, Procedure sp_sdidebug, Line 1
> [Microsoft][ODBC SQL Server Driver][SQL Server]Unable to connect to
> debugger on QAIMGSQL01 (Error = 0x80070005). Ensure that client-side
> components, such as SQLDBREG.EXE, are installed and registered on
> DVO-D1. Debugging disabled for connection 74.
Which version do you have of the client tools? (Visible under Help->About)
Which version is the remote SQL Server? (SELECT @.@.version)
Are you running Windows XP SP2, and have the firewall enabled?
If you XP SP2 with the firewall, both the client tools and the server
needs to be on Service Pack4 for SQL 2000. Futhermore, you need to
configure the firewall, so that SQL Server can access port 135 (RPC) on
your machine. Click the Windows Firewall applet in the Control Panel,
and go the Exceptions tab and select Add Port. In this dialog, be sure
to use Change Scope to open the port only for the SQL Server machine.
And when you've done all this, you may find that it still does not
work. I had i working at the office for a while when we had gotten
hotfix 8.00.944, a pre-SP4 fix. Then our sy
min changed something;I think the priveleges of the service account for SQL Server. I have
since then given up on SQL debugging. It is just too much hassle.
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|||I too had similar problems, and essentially, like Erland mentioned, gave up
on remote debugging. Debugging can be handy, so when I really need it, I
actually copy the database locally, so I can debug.
Jef
"Lianne Kwock" <LianneKwock@.discussions.microsoft.com> wrote in message
news:2909E993-E2FA-4F4E-863F-39F95A97F987@.microsoft.com...
> Hello,
> I got the following error message when I was trying to debug a stored
> procedure sitting on a remote sql database server. I have no problem
> running the debugger on the local server. It just don't work if I try to
> debug a stored procedure on a different server. Here is the error message
> I
> got from query analyzer:
>
> Server: Msg 504, Level 16, State 1, Procedure sp_sdidebug, Line 1
> [Microsoft][ODBC SQL Server Driver][SQL Server]Unable to connect to
> debugger
> on QAIMGSQL01 (Error = 0x80070005). Ensure that client-side components,
> such
> as SQLDBREG.EXE, are installed and registered on DVO-D1. Debugging
> disabled
> for connection 74.
>
> Any input is highly appreciated.
>
> Thanks,
> Lianne
>
Subscribe to:
Posts (Atom)