Examples

Find examples for using dbcc upgrade_object.


  1. Example 1 – Upgrades all compiled objects in the active database:
    dbcc upgrade_object
  2. Example 2 – Upgrades all stored procedures in the listdb database. Single quotes are used around procedure because set quoted identifiers is on:
    dbcc upgrade_object(listdb, 'procedure')
  3. Example 3 – Upgrades all rules and check constraints in the listdb database. Double quotes are used around rule because set quoted identifiers is off.
    dbcc upgrade_object(listdb, "rule")
  4. Example 4 – Upgrades all stored procedures named list_proc in the listdb database.
    dbcc upgrade_object(listdb, list_proc)
  5. Example 5 – Upgrades the stored procedure list_proc, which is owned by the login “jkarrik”.
    dbcc upgrade_object(listdb, 
      "listdb.jkarrik.list_proc")
  6. Example 6 – Returns an error because the value of dbname is master and the value of database is listdb. These values must match.
    dbcc upgrade_object(master, 
      "listdb.jkarrik.list_proc")