Unix Technical Forum

Problems with 'sp_helpdb' stored procedure

This is a discussion on Problems with 'sp_helpdb' stored procedure within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, One of our customers claims that the sp_helpdb truncates database name larger than 24 characters, the release is ...


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 02-29-2008, 03:36 AM
Eyal Goren
 
Posts: n/a
Default Problems with 'sp_helpdb' stored procedure

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 ???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 03:36 AM
Greg D. Moore \(Strider\)
 
Posts: n/a
Default Re: Problems with 'sp_helpdb' stored procedure


"Eyal Goren" <eyal_goren@bmc.com> wrote in message
news:88eabf1e.0404240956.2861e16c@posting.google.c om...
> 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 ???


Probably easy enough to determine.

sp_helptext sp_helpdb

And they can read the text for themselves.

I don't see anything limiting to 24 characters at a quick pass. The user
defined datatype of sysname should be limited to 128 characters.

Perhaps someone changed it?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 03:37 AM
Erland Sommarskog
 
Posts: n/a
Default Re: Problems with 'sp_helpdb' stored procedure

Eyal Goren (eyal_goren@bmc.com) writes:
> 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 ???


Yes, I was able to repeat this problem on an SQL7 server. It turns
out that in the final SELECT, there is an explicit substring():

select name = substring(d.name, 1, 24),
db_size = str(sum(convert(dec(15),v.size))*
(select low from master.dbo.spt_values
where type = 'E' and number = 1)
/ 1048576,10,2)+ ' MB',
owner = substring(suser_sname(d.sid), 1, 24),
dbid = d.dbid,
created = convert(char(11), d.crdate),
status = s.dbdesc
from master.dbo.sysdatabases d, #spfiledesc v, #spdbdesc s
where d.dbid = s.dbid
and s.dbid = v.dbid
group by d.name,d.sid,d.dbid,d.crdate,s.dbdesc
order by d.name

If you are really venturesome you could change the procedure yourself,
but note that this is definitely not supported.

This problem does not appear in SQL2000.


--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
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


All times are GMT. The time now is 10:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com