Re: Renaming Stored Prcedures via EM

From: Anthony Faull (anthony.faull_at_SPAMSPAMSPAMILOVESPAMsanlam.co.za)
Date: 09/03/04


Date: Fri, 3 Sep 2004 11:55:52 +0200

Internally SQL Server keeps the stored procedure name in two places.
Database object names are in table called sysobjects. Create statements are
stored in syscomments. I think it is a bug in SQL Server that sp_rename does
not change both.

    SELECT [name]
    FROM sysobjects
    WHERE [id] = OBJECT_ID('dbo.GetCustomers')

    SELECT [text]
    FROM syscomments
    WHERE [id] = OBJECT_ID('dbo.GetCustomers')

Anthony



Relevant Pages

  • Re: sp_prepexec and sys_comments
    ... Syscomments is for code that is persisted in a SQL Server database, ... a stored procedure, function, view, etc. Prepared statements are not to be ...
    (microsoft.public.sqlserver.odbc)
  • Re: Stored procedure Replication
    ... A stored procedure is stored in syscomments, ... we can't replicate system tables. ... Paul Ibison SQL Server MVP, ...
    (microsoft.public.sqlserver.replication)
  • Re: [Full-disclosure] SQL Injection + Stored Procedures
    ... Stored procedures are saved in the syscomments table in the text field. ... They are then tied to the sysobjects table by the field id. ... That query would retrieve the body of the stored procedure based on the stored procedure name. ... Hosted and sponsored by Secunia - http://secunia.com/ ...
    (Full-Disclosure)
  • RE: Problem when converting from mssql6.5 to mssql2000
    ... If the stored procedure text is missing from the syscomments table the ... upgrade will not be able to upgrade the stored procedures. ... Connect to the SQL Server 6.5 server and run the following command from ...
    (microsoft.public.sqlserver.setup)
  • Re: How to get list of EventClasses in MSSQLServer2000
    ... statement inside a stored procedure has completed.') ... SQL Server statement or stored procedure.') ... Plan','Displays the plan tree of the Transact-SQL statement executed.') ... Login','Occurs when a SQL Server login is added or removed; ...
    (microsoft.public.sqlserver.security)