Re: Edit System Stored Procedure, i.e. sp_helpdb

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 08/26/04


Date: Thu, 26 Aug 2004 19:25:34 +0200

Perhaps that bug only show itself if you have an owner of a database that doesn't exist in syslogins?

-- 
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"NRS" <NRS@discussions.microsoft.com> wrote in message
news:41773F80-647D-4E34-A26E-BF3ACA652F89@microsoft.com...
> I know it's strange and I have the same thought as you.
> I am asking this question because of one colleague that does not know SQL
> Server.
> So I talk with her right know to know exactly the problem, and she show me a
> email from technical support of Scala where they explain:
>
> The Installation wizard uses a Stored Procedure on the SQL server called
> sp_helpdb that retrieves information on the iScala databases. Information
> like Collation/sortorder etc. Sometimes the Stored Procedure retrieves null
> values instead of real values which causes the Stored Procedure itself to
> crash. (Microsoft Bug).
>
> Workaround:
> - Open the Enterprise Manager (SQL).
> - Select Databases = Master
> - Select Stored Procedures
> - Doubleklick the storedprocedure named "sp_helpdb"
> - Change the line that begins with:
> ******************************
> create table #spdbdesc
> (
>  dbname sysname,
>  owner sysname,
>  created nvarchar(11),
>  dbid smallint,
>  dbdesc nvarchar(600) null,
>  dbsize  nvarchar(13) null,
>  cmptlevel tinyint
> )
> ******************************
>
> Change to:
> ******************************
> create table #spdbdesc
> (
>  dbname sysname,
>  owner sysname null,
>  created nvarchar(11),
>  dbid smallint,
>  dbdesc nvarchar(600) null,
>  dbsize  nvarchar(13) null,
>  cmptlevel tinyint
> )
> ******************************
>
> The oly diference is in this line
> owner sysname null,
> where they add null.
>
> I really don't beleave it, that is a MS Bug like they say. I beleave if it
> was a bug it as already been corrected (it's too simple and someone should
> found after the release of SQL 2000).
> As a matter of fact, I went checking the Server to see if have the latest
> service pack, because if was a bug i think that sould be resolved in SP of
> SQL, but she got the SP3.
> I have to check with Scala this question again.
> Thanks
> NRS
>
> "Tibor Karaszi" wrote:
>
> > It is not supported by MS to change the source code in SQL Server. Are you *really* sure that you want an
> > unsupported SQL Server installation. What about other code (Enterprise Manager, Query Analyzer etc etc)
that
> > might use sp_helpdb?
> >
> > -- 
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "NRS" <NRS@discussions.microsoft.com> wrote in message
> > news:21FA6250-6782-4368-9895-D7ED2A042421@microsoft.com...
> > > That's one of the solutions, but not for my problem, because I need to call
> > > it sp_helpdb, I have one call from one application to that stored procedure
> > > that needs to be changed. So if I create a new one with my modifications it
> > > won't work because i don't have the source code of the apllication to change
> > > the call to the stored procedure.
> > >
> > > Thanks,
> > > NRS
> >
> >
> >


Relevant Pages

  • Re: Is there a way to determine who created a stored procedure?
    ... determine who created a stored procedure? ... owner would reveal the answer, but the owner is by default always the ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)
  • Re: Transaction problem (delete / select)
    ... It is not a bug. ... lock or a page lock during the delete. ... you are expecting SQL Server to look at data that will all be ...
    (microsoft.public.sqlserver.server)
  • Re: SP1 does not work
    ... Perhaps you hit some other bug then the one referred to in SP1? ... > This mail is regarding a trouble I'm facing with SQL Server 2000. ... but at times I get a fatal SQL Server Exception when I ... > every time I go to the database with a new connection. ...
    (microsoft.public.sqlserver.programming)
  • Re: SP1 does not work
    ... Perhaps you hit some other bug then the one referred to in SP1? ... > This mail is regarding a trouble I'm facing with SQL Server 2000. ... but at times I get a fatal SQL Server Exception when I ... > every time I go to the database with a new connection. ...
    (microsoft.public.sqlserver.setup)
  • Re: ORDER BY in VIEW not working
    ... purpose in a view or derived table is solely to filter the set of rows ... doing exactly what it is supposed to do and there is no bug. ... remedied somewhat in SQL Server 2005 by the addition of the SQL OLAP ... functions that have their own dedicated ORDER BY clause. ...
    (comp.databases.ms-sqlserver)