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. Query to Test for SA [modified]

Query to Test for SA [modified]

Scheduled Pinned Locked Moved Database
questiondatabase
6 Posts 4 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.
  • M Offline
    M Offline
    mobius111001
    wrote on last edited by
    #1

    What is a good query to execute to see if the account you are logged in as has sysadmin rights?

    modified on Tuesday, December 22, 2009 1:48 PM

    D G M 3 Replies Last reply
    0
    • M mobius111001

      What is a good query to execute to see if the account you are logged in as has sysadmin rights?

      modified on Tuesday, December 22, 2009 1:48 PM

      D Offline
      D Offline
      Dr Walt Fair PE
      wrote on last edited by
      #2

      Are you talking about South Africa or South America?

      CQ de W5ALT

      Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

      M 1 Reply Last reply
      0
      • D Dr Walt Fair PE

        Are you talking about South Africa or South America?

        CQ de W5ALT

        Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

        M Offline
        M Offline
        mobius111001
        wrote on last edited by
        #3

        Modified original message.

        1 Reply Last reply
        0
        • M mobius111001

          What is a good query to execute to see if the account you are logged in as has sysadmin rights?

          modified on Tuesday, December 22, 2009 1:48 PM

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          Try dropping the databases. If you succeed it means that you have more permission then you need.

          Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

          L 1 Reply Last reply
          0
          • M mobius111001

            What is a good query to execute to see if the account you are logged in as has sysadmin rights?

            modified on Tuesday, December 22, 2009 1:48 PM

            M Offline
            M Offline
            mobius111001
            wrote on last edited by
            #5

            Found this handy function IS_SRVROLEMEMBER ( 'role' [ , 'login' ] ). It will return either or a 1 or 0. ex. SELECT IS_SRVROLEMEMBER( 'sysadmin', 'user_name' ) Problem solved.

            1 Reply Last reply
            0
            • G Giorgi Dalakishvili

              Try dropping the databases. If you succeed it means that you have more permission then you need.

              Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              :laugh:

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


              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