473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Sep 11 '08 #1
5 5405
ph3ng (jt****@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, es****@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

Sep 11 '08 #2
On Sep 12, 7:37*am, Erland Sommarskog <esq...@sommarskog.sewrote:
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
Sep 11 '08 #3
On Sep 12, 9:30*am, ph3ng <jth...@gmail.comwrote:
On Sep 12, 7:37*am, Erland Sommarskog <esq...@sommarskog.sewrote:
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.
================================================== ==================

Sep 11 '08 #4
ph3ng (jt****@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, es****@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

Sep 12 '08 #5
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" <jt****@gmail.comwrote in message
news:8e**********************************@p31g2000 prf.googlegroups.com...
On Sep 12, 9:30 am, ph3ng <jth...@gmail.comwrote:
On Sep 12, 7:37 am, Erland Sommarskog <esq...@sommarskog.sewrote:
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.
================================================== ==================

Sep 15 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Eyal Goren | last post by:
Hi, One of our customers claims that the sp_helpdb truncates database name larger than 24 characters, the release is 7.00.1094, did any one encounter such a problem ???
1
by: [BuKoX] | last post by:
Hello. How to format field "create" (Jan 12 2005) in sp_helpdb procedure to sth like yyyy-mm-dd (2005-01-12) in SQL? bye... -- __ __ |__\\ | || |_// / \\ \_// ...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
0
by: Nalla | last post by:
Hi, I have a requirement to call webservices from my old C++ application.So first I tried with Vc++.net as follows.....There are 2 approach Dotnet frame work and soaptoolkit 3.0 I am not able to...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
10
by: TF | last post by:
Very newbie question and I hope this is the right group. I have a table on a web page which contains info about paint colors. One column contains the hex value for the color's RGB value. I want...
3
by: sachin shah | last post by:
hi all my query is how can i send mail by using sql server, i think by unsing xp_sendmail store procedure we can do this but my problem is what paramater to be pass to this store procedure if i...
2
by: Manikandan | last post by:
Hi, I have a program written in .Net Framework 1.1 using Visual studio enterprise edition 2003. I tried compiling the same program in visual c# express edition 2005. I'm getting following...
2
by: moonrox | last post by:
Thanks for you help in advance. I am trying to use sp_helpdb to get the size of all the databases on a sql server. The results of sp_helpdb (when using the @dbname='databasename') is 2 sets of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.