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. Other Discussions
  3. The Weird and The Wonderful
  4. Ran across this sql the other day.

Ran across this sql the other day.

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasesql-serversysadmintools
7 Posts 7 Posters 7 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.
  • A Offline
    A Offline
    Austin Harris
    wrote on last edited by
    #1

    USE [Database1]
    GO
    /****** Object: StoredProcedure [dbo].[CheckConnection] Script Date: 08/14/2008 10:54:38 ******/
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    -- Validate User can hit the sql box. Basically doesn't do anything, except ensure I can see the sql box
    -- Returns 1 if successful,
    -- 0 l if failed (one could ask, If I can't see the box, how is it going to return 0....I don't know).
    -- 3/26/04 (via name omitted)
    -- Assumes SQL Server 7.0 SP1 or better
    ALTER procedure [dbo].[CheckConnection]
    @result char(1) OUTPUT
    AS
    set @result = "1"
    RETURN

    :laugh:

    P B P Y M 5 Replies Last reply
    0
    • A Austin Harris

      USE [Database1]
      GO
      /****** Object: StoredProcedure [dbo].[CheckConnection] Script Date: 08/14/2008 10:54:38 ******/
      SET ANSI_NULLS OFF
      GO
      SET QUOTED_IDENTIFIER OFF
      GO
      -- Validate User can hit the sql box. Basically doesn't do anything, except ensure I can see the sql box
      -- Returns 1 if successful,
      -- 0 l if failed (one could ask, If I can't see the box, how is it going to return 0....I don't know).
      -- 3/26/04 (via name omitted)
      -- Assumes SQL Server 7.0 SP1 or better
      ALTER procedure [dbo].[CheckConnection]
      @result char(1) OUTPUT
      AS
      set @result = "1"
      RETURN

      :laugh:

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      :omg: Hokay. So you can't just test the state of the connection then...

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      P 1 Reply Last reply
      0
      • A Austin Harris

        USE [Database1]
        GO
        /****** Object: StoredProcedure [dbo].[CheckConnection] Script Date: 08/14/2008 10:54:38 ******/
        SET ANSI_NULLS OFF
        GO
        SET QUOTED_IDENTIFIER OFF
        GO
        -- Validate User can hit the sql box. Basically doesn't do anything, except ensure I can see the sql box
        -- Returns 1 if successful,
        -- 0 l if failed (one could ask, If I can't see the box, how is it going to return 0....I don't know).
        -- 3/26/04 (via name omitted)
        -- Assumes SQL Server 7.0 SP1 or better
        ALTER procedure [dbo].[CheckConnection]
        @result char(1) OUTPUT
        AS
        set @result = "1"
        RETURN

        :laugh:

        B Offline
        B Offline
        Brent Lamborn
        wrote on last edited by
        #3

        :laugh:

        Austin Harris wrote:

        If I can't see the box, how is it going to return 0....I don't know

        :laugh:


        "Half this game is ninety percent mental." - Yogi Berra If you can read thank a teacher, if you can read in English, thank a Marine.

        1 Reply Last reply
        0
        • P Pete OHanlon

          :omg: Hokay. So you can't just test the state of the connection then...

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          No of course not... security and permissions you know. :-D

          1 Reply Last reply
          0
          • A Austin Harris

            USE [Database1]
            GO
            /****** Object: StoredProcedure [dbo].[CheckConnection] Script Date: 08/14/2008 10:54:38 ******/
            SET ANSI_NULLS OFF
            GO
            SET QUOTED_IDENTIFIER OFF
            GO
            -- Validate User can hit the sql box. Basically doesn't do anything, except ensure I can see the sql box
            -- Returns 1 if successful,
            -- 0 l if failed (one could ask, If I can't see the box, how is it going to return 0....I don't know).
            -- 3/26/04 (via name omitted)
            -- Assumes SQL Server 7.0 SP1 or better
            ALTER procedure [dbo].[CheckConnection]
            @result char(1) OUTPUT
            AS
            set @result = "1"
            RETURN

            :laugh:

            P Offline
            P Offline
            Paul Conrad
            wrote on last edited by
            #5

            :laugh::laugh::laugh:

            "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

            1 Reply Last reply
            0
            • A Austin Harris

              USE [Database1]
              GO
              /****** Object: StoredProcedure [dbo].[CheckConnection] Script Date: 08/14/2008 10:54:38 ******/
              SET ANSI_NULLS OFF
              GO
              SET QUOTED_IDENTIFIER OFF
              GO
              -- Validate User can hit the sql box. Basically doesn't do anything, except ensure I can see the sql box
              -- Returns 1 if successful,
              -- 0 l if failed (one could ask, If I can't see the box, how is it going to return 0....I don't know).
              -- 3/26/04 (via name omitted)
              -- Assumes SQL Server 7.0 SP1 or better
              ALTER procedure [dbo].[CheckConnection]
              @result char(1) OUTPUT
              AS
              set @result = "1"
              RETURN

              :laugh:

              Y Offline
              Y Offline
              Yusuf
              wrote on last edited by
              #6

              :laugh: :omg: :laugh: knock knock, who is there? SQL Connection, SQL connection who .... :^)

              Yusuf

              1 Reply Last reply
              0
              • A Austin Harris

                USE [Database1]
                GO
                /****** Object: StoredProcedure [dbo].[CheckConnection] Script Date: 08/14/2008 10:54:38 ******/
                SET ANSI_NULLS OFF
                GO
                SET QUOTED_IDENTIFIER OFF
                GO
                -- Validate User can hit the sql box. Basically doesn't do anything, except ensure I can see the sql box
                -- Returns 1 if successful,
                -- 0 l if failed (one could ask, If I can't see the box, how is it going to return 0....I don't know).
                -- 3/26/04 (via name omitted)
                -- Assumes SQL Server 7.0 SP1 or better
                ALTER procedure [dbo].[CheckConnection]
                @result char(1) OUTPUT
                AS
                set @result = "1"
                RETURN

                :laugh:

                M Offline
                M Offline
                Mike Dimmick
                wrote on last edited by
                #7

                We used to have a standard stored procedure that did that. I pointed out that a successful 'ping' didn't mean anything at all: the server could be down or the connection lost by the time that the next call was made. It's been phased out. Someone did claim that there was a problem with some old version of ADO that wouldn't return the results of the first stored procedure call you made after connecting, and so you called a dummy procedure before what you actually wanted to do. I'm skeptical - I've never seen a bug report on that. It smells of cargo-cult programming, and of the worst kind: chinese-whispers cargo-cult programming, where the implementor has heard that there's a problem and has heard that this will fix it, but has not experienced the problem themselves.

                DoEvents: Generating unexpected recursion since 1991

                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