Unix Technical Forum

using sp_helpdb and getting error

This is a discussion on using sp_helpdb and getting error within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi I was executing sp_help on a server (ran against master database) and i get the following message: [Microsoft][ODBC ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-12-2008, 05:23 PM
ph3ng
 
Posts: n/a
Default using sp_helpdb and getting error

Hi

I was executing sp_help on a server (ran against master database) and
i get the following message:

[Microsoft][ODBC SQL Server Driver]Associated statement is not
prepared(HY007)


Anyone got any idea what is wrong?

Thank you in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-12-2008, 05:23 PM
Erland Sommarskog
 
Posts: n/a
Default Re: using sp_helpdb and getting error

ph3ng (jthlcf@gmail.com) writes:
> I was executing sp_help on a server (ran against master database) and
> i get the following message:
>
> [Microsoft][ODBC SQL Server Driver]Associated statement is not
> prepared(HY007)


Where did you run it? Which version of SQL Server? And what did you
run? sp_help or sp_helpdb? Any parameters?


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-12-2008, 05:23 PM
ph3ng
 
Posts: n/a
Default Re: using sp_helpdb and getting error

On Sep 12, 7:37*am, Erland Sommarskog <esq...@sommarskog.se> wrote:
> ph3ng (jth...@gmail.com) writes:
> > I was executing sp_help on a server (ran against master database) and
> > i get the following message:

>
> > [Microsoft][ODBC SQL Server Driver]Associated statement is not
> > prepared(HY007)

>
> Where did you run it? Which version of SQL Server? And what did you
> run? sp_help or sp_helpdb? Any parameters?
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Links for SQL Server Books Online:
> SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
> SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx


My bad. Hadn't realised I've accidentally given some inaccurate info.

I've used sp_helpdb. I am using MSSQL 2000. No parameters - just
sp_helpdb.

I've ran it in via DBArtisan's ISQL window against the master database
of a MSSQL server.

Hope this provides a clearer picture. Thank you and my apologies for
that.

Justin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-12-2008, 05:23 PM
ph3ng
 
Posts: n/a
Default Re: using sp_helpdb and getting error

On Sep 12, 9:30*am, ph3ng <jth...@gmail.com> wrote:
> On Sep 12, 7:37*am, Erland Sommarskog <esq...@sommarskog.se> wrote:
>
>
>
> > ph3ng (jth...@gmail.com) writes:
> > > I was executing sp_help on a server (ran against master database) and
> > > i get the following message:

>
> > > [Microsoft][ODBC SQL Server Driver]Associated statement is not
> > > prepared(HY007)

>
> > Where did you run it? Which version of SQL Server? And what did you
> > run? sp_help or sp_helpdb? Any parameters?

>
> > --
> > Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

>
> > Links for SQL Server Books Online:
> > SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> > SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
> > SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx

>
> My bad. Hadn't realised I've accidentally given some inaccurate info.
>
> I've used sp_helpdb. I am using MSSQL 2000. No parameters - just
> sp_helpdb.
>
> I've ran it in via DBArtisan's ISQL window against the master database
> of a MSSQL server.
>
> Hope this provides a clearer picture. Thank you and my apologies for
> that.
>
> Justin


Interestingly, I've just tried to run sp_helpdb via SQL Query Analyzer
on the same MSSQL server (against the master db) and I get the
following error:

================================================== ==================
Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53
Cannot insert the value NULL into column '', table ''; column does not
allow nulls. INSERT fails.
The statement has been terminated.
================================================== ==================

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-16-2008, 12:13 PM
Erland Sommarskog
 
Posts: n/a
Default Re: using sp_helpdb and getting error

ph3ng (jthlcf@gmail.com) writes:
>> I've ran it in via DBArtisan's ISQL window against the master database
>> of a MSSQL server.
>>...

> Interestingly, I've just tried to run sp_helpdb via SQL Query Analyzer
> on the same MSSQL server (against the master db) and I get the
> following error:
>
>================================================= ===================
> Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53
> Cannot insert the value NULL into column '', table ''; column does not
> allow nulls. INSERT fails.
> The statement has been terminated.
>================================================= ===================


Apparently DBArtisan is not very good at handling the error messages from
SQL Server. Not that it's unique. OdbcClient in .Net has similar problems.
Then again, I guess DBArtisan is able to connect to other database products
as well, so it has a more difficult task than Query Analyzer.

As for the error message, run this SELECT:

select name, sid, suser_sname(sid), convert(nvarchar(11), crdate),
dbid, cmptlevel from master.dbo.sysdatabases

Which of the columns are NULL? I would guess it's suser_sname(sid).
This would indicated that the database in question is owned by a
login that no longer exists.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-16-2008, 12:13 PM
Dan Guzman
 
Posts: n/a
Default Re: using sp_helpdb and getting error

> Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53
> Cannot insert the value NULL into column '', table ''; column does not
> allow nulls. INSERT fails.


I agree with Erland that the likly cause of this error is that the database
owner login no longer exists. You can correct with sp_changedbowner. For
example:

USE MyDatabase
EXEC sp_changedbowner 'sa'

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"ph3ng" <jthlcf@gmail.com> wrote in message
news:8e04c62d-c2c2-4f45-9a0c-458aa7ba91ff@p31g2000prf.googlegroups.com...
On Sep 12, 9:30 am, ph3ng <jth...@gmail.com> wrote:
> On Sep 12, 7:37 am, Erland Sommarskog <esq...@sommarskog.se> wrote:
>
>
>
> > ph3ng (jth...@gmail.com) writes:
> > > I was executing sp_help on a server (ran against master database) and
> > > i get the following message:

>
> > > [Microsoft][ODBC SQL Server Driver]Associated statement is not
> > > prepared(HY007)

>
> > Where did you run it? Which version of SQL Server? And what did you
> > run? sp_help or sp_helpdb? Any parameters?

>
> > --
> > Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

>
> > Links for SQL Server Books Online:
> > SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> > SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
> > SQL
> > 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx

>
> My bad. Hadn't realised I've accidentally given some inaccurate info.
>
> I've used sp_helpdb. I am using MSSQL 2000. No parameters - just
> sp_helpdb.
>
> I've ran it in via DBArtisan's ISQL window against the master database
> of a MSSQL server.
>
> Hope this provides a clearer picture. Thank you and my apologies for
> that.
>
> Justin


Interestingly, I've just tried to run sp_helpdb via SQL Query Analyzer
on the same MSSQL server (against the master db) and I get the
following error:

================================================== ==================
Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53
Cannot insert the value NULL into column '', table ''; column does not
allow nulls. INSERT fails.
The statement has been terminated.
================================================== ==================

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads for: using sp_helpdb and getting error

Thread Thread Starter Forum Replies Last Post
sp_helpdb missing a database ashish Sybase 2 04-08-2008 06:53 PM
'sp_helpdb' query jerke szabo Sybase 3 04-08-2008 04:23 PM
Why is sp_helpdb and sysdatabases different Akinja SQL Server 2 02-29-2008 09:16 AM
Format result of sp_helpdb [BuKoX] SQL Server 1 02-29-2008 07:25 AM
Problems with 'sp_helpdb' stored procedure Eyal Goren SQL Server 2 02-29-2008 03:37 AM


All times are GMT. The time now is 06:01 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com