Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Trouble understanding following sql

Trouble understanding following sql

Scheduled Pinned Locked Moved Database
questiondatabasecom
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pzn3xq
    wrote on last edited by
    #1

    I'm reviewing the procs in http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=FileSpaceMon&referringTitle=Home, and have a couple question at the sql statement below: 1) where is the tempdb..sysobjects in sqlserver manager? I see a tempdb under the 'master' db...is that created by default? I don't understand why they have two periods (dot dot) in the tempdb..sysobjects. I do not see a sysobjects table within the tempdb. 2) Can someone explain the '#' in the LIKE '#FileSpaceStats%'. The % is the wildcard, but what is the leading # used for? IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE name LIKE '#FileSpaceStats%') BEGIN DROP TABLE #FileSpaceStats END Thanks

    S 1 Reply Last reply
    0
    • P pzn3xq

      I'm reviewing the procs in http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=FileSpaceMon&referringTitle=Home, and have a couple question at the sql statement below: 1) where is the tempdb..sysobjects in sqlserver manager? I see a tempdb under the 'master' db...is that created by default? I don't understand why they have two periods (dot dot) in the tempdb..sysobjects. I do not see a sysobjects table within the tempdb. 2) Can someone explain the '#' in the LIKE '#FileSpaceStats%'. The % is the wildcard, but what is the leading # used for? IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE name LIKE '#FileSpaceStats%') BEGIN DROP TABLE #FileSpaceStats END Thanks

      S Offline
      S Offline
      Syed Mehroz Alam
      wrote on last edited by
      #2

      pzn3xq wrote:

      IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE name LIKE '#FileSpaceStats%') BEGIN DROP TABLE #FileSpaceStats END

      # means a temporary table and such tables are stored in the tempdb. So the above query looks for a temp table starting with FileSpaceStats and drops #FileSpaceStats in case it exists. Hope that helps. Regards, Syed Mehroz Alam

      My Blog My Articles Computers are incredibly fast, accurate, and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination. - Albert Einstein

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups