what s the equivalenet of object_definition in sql 2000 pls

This is not working for me in sql 2000. It works well in sql 2005

use mosaikdb741
select object_definition(o.object_id),o.name from sys.objects as o

thanks a lot




Answer this question

what s the equivalenet of object_definition in sql 2000 pls

  • govindpandey

    OBJECT_DEFINITION is a new function in SQL Server 2005. The nearest equivalent system stored procedure for this in SQL Server 2000 is the sp_helptext, which will only work for stored procedures, user-defined functions, triggers and views.

    SQL Server Helper
    http://www.sql-server-helper.com


  • PK_VBE05

    how d this translate using sp_helptext then

    exec sp_msforeachdb '

    select '' '', o.name, object_definition(o.object_id) from [ ].sys.objects as o where

    object_definition(o.object_id) like ''%mykeyword%'' and o.type=''P'''

    Thanks a lot



  • Banna

    use the system table syscomments in sql server 2000.

    exec sp_msforeachdb '

    select '' '', o.name, c.text from sysobjects as o join syscomments as c on (o.id=c.id) where

    c.text like ''%mykeyword%'' and o.xtype=''P'''



  • what s the equivalenet of object_definition in sql 2000 pls