• Indianrock (9/19/2013)


    Sql 2012 Enterprise installation. user databases are all fine. Managing objects in management studio doesn't work. We know an application wrote its tables into the master database by mistake. I found the utables.sql script which will recreate the master database views, but it fails because it can't find sys.spt_values

    Invalid object name 'sys.spt_values' I have backups of master but was hoping this script would work.

    create view spt_values as

    select name collate database_default as name,

    number,

    type collate database_default as type,

    low, high, status

    from sys.spt_values

    go

    I don't have 2k12 to confirm but try dbo.spt_values instead of sys.spt_values.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)