sql server 2008 sql

  • I would like to know the following:

    1. What t-sql can I use to see if a stored procedure has changed? I want to see the last modified date? Would I look at

    sysobjects?

    2. What t-sql would I use to see if a view and function changed. I would like to see the last modified date? Would I look at

    sysview?

  • Right-click on the database you want to check and run the Schema Changes History report. Note, this report uses the default trace and will only go back as far as that trace has data.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Interview question? Homework?

    sysobjects is deprecated, included only for backward compat, should not be used any longer, will be removed from a future version.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • USE some_database_name

    GO

    SELECT name,

    create_date,

    modify_date

    FROM sys.views

    SELECT name,

    create_date,

    modify_date

    FROM sys.procedures

    GO

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • For functions:

    SELECT *

    FROM sys.objects

    WHERE type IN (N'FN', N'IF', N'TF', N'FS', N'FT') ;

    /*

    From http://msdn.microsoft.com/en-us/library/ms177596.aspx:

    FNSQL_SCALAR_FUNCTION

    FSAssembly (CLR) scalar-function

    FTAssembly (CLR) table-valued function

    IFSQL_INLINE_TABLE_VALUED_FUNCTION

    TFSQL_TABLE_VALUED_FUNCTION

    */

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply