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. How to find a stored procedure by Author's HostName or LoginName

How to find a stored procedure by Author's HostName or LoginName

Scheduled Pinned Locked Moved Database
databasetutorial
5 Posts 4 Posters 1 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.
  • M Offline
    M Offline
    Mphirana
    wrote on last edited by
    #1

    Hi I want to get all the proc names that were created or modified by a specific user or from a specific computer in the database. Thank you

    L CHill60C Kornfeld Eliyahu PeterK 3 Replies Last reply
    0
    • M Mphirana

      Hi I want to get all the proc names that were created or modified by a specific user or from a specific computer in the database. Thank you

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I would guess you are using Sql Server. AFAIK, there is no way to do so. The sys.procedures table does not show any field that matches what you request. There is, see post below;

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

      1 Reply Last reply
      0
      • M Mphirana

        Hi I want to get all the proc names that were created or modified by a specific user or from a specific computer in the database. Thank you

        CHill60C Offline
        CHill60C Offline
        CHill60
        wrote on last edited by
        #3

        Closest I can think of is to list the SPs by "owner" ...don't think it's what you're after though. E.g.

        exec sp_stored_procedures @sp_owner = 'dbo'

        Or you could try using a log reader

        L 1 Reply Last reply
        0
        • CHill60C CHill60

          Closest I can think of is to list the SPs by "owner" ...don't think it's what you're after though. E.g.

          exec sp_stored_procedures @sp_owner = 'dbo'

          Or you could try using a log reader

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          :thumbsup:

          SELECT *
          FROM sys.fn_dblog(NULL,NULL)

          ..but only if there's a decent log, and if they did not log in using the sa-account.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

          1 Reply Last reply
          0
          • M Mphirana

            Hi I want to get all the proc names that were created or modified by a specific user or from a specific computer in the database. Thank you

            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu Peter
            wrote on last edited by
            #5

            SQL does not! stores information about the person (user) modified any of its object, the only information stored is the last date it modified... You may look into the trc files of the default trace (you may need to enable it), but it is good for a short time as it being overwritten periodically...

            Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

            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