dbTalk Databases Forums  

SQL server 2005 Express - Vista - Invalid object name '#spdbdesc'

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss SQL server 2005 Express - Vista - Invalid object name '#spdbdesc' in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ianforgroupuse@hotmail.co.uk
 
Posts: n/a

Default SQL server 2005 Express - Vista - Invalid object name '#spdbdesc' - 04-02-2007 , 07:10 AM






I'm running Vista Business edition on 2005 Virtual PC.
Installed SQL Server 2005 Express latest download, with instance of
MSSQLSERVER and service accounts running under "NT AUTHORITY\SYSTEM".
Mixed mode authentication specified and sa password specified.
Used server manager to create user login with sysadmin role.
Login using windows authentication.

Run my application and database is created and populated with default
records.

However, my application executes the stored procedure "sp_helpdb"
which fails with "Invalid object name '#spdbdesc'" error.

If I run a query in server manager to execute same procedure logged
in
as the same person it runs ok and returns a table of information.

All this was working ok on XP with MSDE2000A previously.

I'm programming in .NET C# CLR2.0, any body know what's going wrong?


Reply With Quote
  #2  
Old   
Dan Guzman
 
Posts: n/a

Default Re: SQL server 2005 Express - Vista - Invalid object name '#spdbdesc' - 04-02-2007 , 07:39 AM






This question was also posted and answered in
microsoft.public.sqlserver.programming. If you need to post the same
question to multiple groups, post the message once to all groups in order to
avoid duplication of effort.


Quote:
However, my application executes the stored procedure "sp_helpdb"
which fails with "Invalid object name '#spdbdesc'" error.
Perhaps the application is retrieving result set meta-data with SET FMTONLY
ON. This will result in an error since the #spdbdesc temp table does not
exist when the proc is executed with SET FMTONLY ON.

Quote:
I'm programming in .NET C# CLR2.0, any body know what's going wrong?
It's difficult to say without seeing your code. The snippet below works for
me with SQL Server Developer Edition under Vista. I would expect it to work
under SQL Express too.


DataTable dt = new DataTable();
SqlConnection connection =
new SqlConnection("Data Source=(local);Integrated Security=SSPI");
SqlCommand command =
new SqlCommand("sp_helpdb", connection);
command.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(command);
connection.Open();
da.Fill(dt);
connection.Close();

--
Hope this helps.

Dan Guzman
SQL Server MVP

<ianforgroupuse (AT) hotmail (DOT) co.uk> wrote

Quote:
I'm running Vista Business edition on 2005 Virtual PC.
Installed SQL Server 2005 Express latest download, with instance of
MSSQLSERVER and service accounts running under "NT AUTHORITY\SYSTEM".
Mixed mode authentication specified and sa password specified.
Used server manager to create user login with sysadmin role.
Login using windows authentication.

Run my application and database is created and populated with default
records.

However, my application executes the stored procedure "sp_helpdb"
which fails with "Invalid object name '#spdbdesc'" error.

If I run a query in server manager to execute same procedure logged
in
as the same person it runs ok and returns a table of information.

All this was working ok on XP with MSDE2000A previously.

I'm programming in .NET C# CLR2.0, any body know what's going wrong?



Reply With Quote
  #3  
Old   
ianforgroupuse@hotmail.co.uk
 
Posts: n/a

Default Re: SQL server 2005 Express - Vista - Invalid object name '#spdbdesc' - 04-02-2007 , 09:13 AM



On 2 Apr, 13:39, "Dan Guzman" <guzma... (AT) nospam-online (DOT) sbcglobal.net>
wrote:
Quote:
This question was also posted and answered in
microsoft.public.sqlserver.programming. If you need to post the same
question to multiple groups, post the message once to all groups in order to
avoid duplication of effort.
Snip

Quote:
Dan Guzman
SQL Server MVP

Snip

Sorry for that, it's the first time I've posted in many years...

If I don't specify SET FMTONLY ON/OFF in my code is there a default
state that I can rely on?
Is it the same for all SQL implementations?
If not, should I set it when opening the connection?

Many thanks

Ian




Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL server 2005 Express - Vista - Invalid object name '#spdbdesc' - 04-02-2007 , 04:50 PM



(ianforgroupuse (AT) hotmail (DOT) co.uk) writes:
Quote:
If I don't specify SET FMTONLY ON/OFF in my code is there a default
state that I can rely on?
SET FMTONLY ON is usually submitted behind the scenes. ADO Classic
is notorious for doing this without being asked. ADO .Net is far more
well-behaved. But if you use CommandBehaviour.MetaDataOnly, there is a
SET FMTONLY sent to SQL Server.

Quote:
Is it the same for all SQL implementations?
It's the client API that gets the idea to issue SET FMTONLY ON, so the
version of SQL Server should not matter.

It could certainly help if you could post your code.
--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.