create proc dbo.get_indexstats throws errrors

Answered create proc dbo.get_indexstats throws errrors

  • Tuesday, May 22, 2012 6:44 PM
     
     

    This sounds like code I can put to good use, but it throws errors after I downloaded it.

    Here is a copy of the error.

    The module 'get_indexstats' depends on the missing object 'dbo.add_column'. The module will still be created; however, it cannot run successfully until the object exists.


    Duane Lawrence

All Replies

  • Tuesday, May 22, 2012 6:49 PM
     
     

    SQL procedure problems are probably better asked in the SQL forums:

    http://social.technet.microsoft.com/Forums/en-US/category/sqlserver

  • Wednesday, May 23, 2012 6:36 AM
    Moderator
     
     Answered Has Code

    The module 'get_indexstats' depends on the missing object 'dbo.add_column'. The module will still be created; however, it cannot run successfully until the object exists.

    Hi duanelawrence,


    You need the stored procedure “dbo.add_column”. Check if the stored procedure exists. Or you could create the procedure ‘‘dbo.add_column’’.

    CREATE procedure [dbo].[ADD_COLUMN] 
    (
    @Name_Table varchar(100),
    @Name_column varchar(100)
    )
    as
    Begin
    declare @sql nvarchar(max)
    set @sql='alter table '+@Name_table +' add '+ @Name_column+ ' int null ' 
    print @sql
    exec (@sql)
    End


    Thanks,
    Maggie



    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.