Loading ...
Sorry, an error occurred while loading the content.
 

Query forcount

Expand Messages
  • ☺Aνιηαѕн ∂єѕαι™☺
    Hi I have a Table Table1 where it has columns like *Column Data Type* Id Int(Auto increment) Value Decimal
    Message 1 of 19 , Dec 27, 2009
      Hi

      I have a Table

      Table1 where it has columns like

      *Column Data Type*
      Id Int(Auto increment)
      Value Decimal
      Description Text
      Type Text

      Data which i insert will be like this

      Value Description Type

      0.00 Loss H
      45.3 Loss U
      12.3 Loss U
      12.3 Loss U
      12.3 Loss H
      12.3 Loss U
      12.3 Loss U


      I just want to get the Count of the H for each row

      So if i query something where i need to get how many Type H Gone before this
      row..


      For example when the second row fetched i need to get 1

      If i get last row output i need to get 2

      Upto dat row H are 2 so . how to get like this . please help me in this

      --
      Thanks & Regards
      Avinash Desai
      *SAVE Nature SAVE Tree SAVE*

      Think Before you print: Please consider our environment before printing this
      e-mail

      Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
      "The trouble with a kitten is that when it grows up, it's always a cat."


      [Non-text portions of this message have been removed]
    • John Warner
      Given what you have shown us, could you show me a SELECT that gets only the second row (don t worry about counting H right now. Sort of: SELECT * FROM table
      Message 2 of 19 , Dec 27, 2009
        Given what you have shown us, could you show me a SELECT that gets only
        the second row (don't worry about counting H right now. Sort of:
        SELECT *
        FROM table
        WHERE ?????

        John Warner


        > -----Original Message-----
        > From: SQLQueriesNoCode@yahoogroups.com
        > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of ?A???a??
        > ???a?T?
        > Sent: Sunday, December 27, 2009 8:46 AM
        > To: SQL Code group
        > Subject: [SQLQueriesNoCode] Query forcount
        >
        > Hi
        >
        > I have a Table
        >
        > Table1 where it has columns like
        >
        > *Column Data Type*
        > Id Int(Auto increment)
        > Value Decimal
        > Description Text
        > Type Text
        >
        > Data which i insert will be like this
        >
        > Value Description Type
        >
        > 0.00 Loss H
        > 45.3 Loss U
        > 12.3 Loss U
        > 12.3 Loss U
        > 12.3 Loss H
        > 12.3 Loss U
        > 12.3 Loss U
        >
        >
        > I just want to get the Count of the H for each row
        >
        > So if i query something where i need to get how many Type H Gone before
        this
        > row..
        >
        >
        > For example when the second row fetched i need to get 1
        >
        > If i get last row output i need to get 2
        >
        > Upto dat row H are 2 so . how to get like this . please help me in this
        >
        > --
        > Thanks & Regards
        > Avinash Desai
        > *SAVE Nature SAVE Tree SAVE*
        >
        > Think Before you print: Please consider our environment before printing
        this
        > e-mail
        >
        > Ogden Nash
        > <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
        > "The trouble with a kitten is that when it grows up, it's always a cat."
        >
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
      • ☺Aνιηαѕн ∂єѕαι™☺
        Hi John see if i query Select * from Table it has to show me that up to dat row how many times H appeared. Dats it :) In where condition i will add where Id
        Message 3 of 19 , Dec 27, 2009
          Hi John see if i query

          Select * from Table it has to show me that up to dat row how many times H
          appeared. Dats it :)

          In where condition i will add where Id =Value

          On Sun, Dec 27, 2009 at 6:31 AM, John Warner <john@...> wrote:

          >
          >
          > Given what you have shown us, could you show me a SELECT that gets only
          > the second row (don't worry about counting H right now. Sort of:
          > SELECT *
          > FROM table
          > WHERE ?????
          >
          > John Warner
          >
          >
          > > -----Original Message-----
          > > From: SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
          > > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>]
          > On Behalf Of ?A???a??
          > > ???a?T?
          > > Sent: Sunday, December 27, 2009 8:46 AM
          > > To: SQL Code group
          > > Subject: [SQLQueriesNoCode] Query forcount
          > >
          > > Hi
          > >
          > > I have a Table
          > >
          > > Table1 where it has columns like
          > >
          > > *Column Data Type*
          > > Id Int(Auto increment)
          > > Value Decimal
          > > Description Text
          > > Type Text
          > >
          > > Data which i insert will be like this
          > >
          > > Value Description Type
          > >
          > > 0.00 Loss H
          > > 45.3 Loss U
          > > 12.3 Loss U
          > > 12.3 Loss U
          > > 12.3 Loss H
          > > 12.3 Loss U
          > > 12.3 Loss U
          > >
          > >
          > > I just want to get the Count of the H for each row
          > >
          > > So if i query something where i need to get how many Type H Gone before
          > this
          > > row..
          > >
          > >
          > > For example when the second row fetched i need to get 1
          > >
          > > If i get last row output i need to get 2
          > >
          > > Upto dat row H are 2 so . how to get like this . please help me in this
          > >
          > > --
          > > Thanks & Regards
          > > Avinash Desai
          > > *SAVE Nature SAVE Tree SAVE*
          > >
          > > Think Before you print: Please consider our environment before printing
          > this
          > > e-mail
          > >
          > > Ogden Nash
          > > <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
          >
          > > "The trouble with a kitten is that when it grows up, it's always a cat."
          > >
          > >
          > > [Non-text portions of this message have been removed]
          > >
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          >
          >
          >



          --
          Thanks & Regards
          Avinash Desai
          *SAVE Nature SAVE Tree SAVE*

          Think Before you print: Please consider our environment before printing this
          e-mail
          Sent from Bangalore, KA, India
          Charles de Gaulle<http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html>
          - "The better I get to know men, the more I find myself loving dogs."


          [Non-text portions of this message have been removed]
        • John Warner
          Read the question carefully below, if you don t understand part of it, ask. Your reply has nothing to do with my question. I cannot help you if you will not
          Message 4 of 19 , Dec 27, 2009
            Read the question carefully below, if you don't understand part of it, ask. Your reply has nothing to do with my question. I cannot help you if you will not help me. Notice the part about DO NOT WORRY ABOUT COUNTING H RIGHT NOW. That last part is critical.

            Given what you have shown us, could you show me a SELECT that gets only
            the second row (don't worry about counting H right now). Sort of:
            SELECT *
            FROM table
            WHERE ?????

            John Warner


            > -----Original Message-----
            > From: SQLQueriesNoCode@yahoogroups.com
            > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of ?A???a??
            > ???a?™?
            > Sent: Sunday, December 27, 2009 9:34 AM
            > To: SQLQueriesNoCode@yahoogroups.com
            > Subject: Re: [SQLQueriesNoCode] Query forcount
            >
            > Hi John see if i query
            >
            > Select * from Table it has to show me that up to dat row how many times H
            > appeared. Dats it :)
            >
            > In where condition i will add where Id =Value
            >
            > On Sun, Dec 27, 2009 at 6:31 AM, John Warner <john@...> wrote:
            >
            > >
            > >
            > > Given what you have shown us, could you show me a SELECT that gets
            > only
            > > the second row (don't worry about counting H right now. Sort of:
            > > SELECT *
            > > FROM table
            > > WHERE ?????
            > >
            > > John Warner
            > >
            > >
            > > > -----Original Message-----
            > > > From:
            > SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogrou
            > ps.com>
            > > >
            > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yah
            > oogroups.com>]
            > > On Behalf Of ?A???a??
            > > > ???a?T?
            > > > Sent: Sunday, December 27, 2009 8:46 AM
            > > > To: SQL Code group
            > > > Subject: [SQLQueriesNoCode] Query forcount
            > > >
            > > > Hi
            > > >
            > > > I have a Table
            > > >
            > > > Table1 where it has columns like
            > > >
            > > > *Column Data Type*
            > > > Id Int(Auto increment)
            > > > Value Decimal
            > > > Description Text
            > > > Type Text
            > > >
            > > > Data which i insert will be like this
            > > >
            > > > Value Description Type
            > > >
            > > > 0.00 Loss H
            > > > 45.3 Loss U
            > > > 12.3 Loss U
            > > > 12.3 Loss U
            > > > 12.3 Loss H
            > > > 12.3 Loss U
            > > > 12.3 Loss U
            > > >
            > > >
            > > > I just want to get the Count of the H for each row
            > > >
            > > > So if i query something where i need to get how many Type H Gone before
            > > this
            > > > row..
            > > >
            > > >
            > > > For example when the second row fetched i need to get 1
            > > >
            > > > If i get last row output i need to get 2
            > > >
            > > > Upto dat row H are 2 so . how to get like this . please help me in this
            > > >
            > > > --
            > > > Thanks & Regards
            > > > Avinash Desai
            > > > *SAVE Nature SAVE Tree SAVE*
            > > >
            > > > Think Before you print: Please consider our environment before printing
            > > this
            > > > e-mail
            > > >
            > > > Ogden Nash
            > > > <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
            > >
            > > > "The trouble with a kitten is that when it grows up, it's always a cat."
            > > >
            > > >
            > > > [Non-text portions of this message have been removed]
            > > >
            > > >
            > > >
            > > > ------------------------------------
            > > >
            > > > Yahoo! Groups Links
            > > >
            > > >
            > > >
            > >
            > >
            > >
            >
            >
            >
            > --
            > Thanks & Regards
            > Avinash Desai
            > *SAVE Nature SAVE Tree SAVE*
            >
            > Think Before you print: Please consider our environment before printing this
            > e-mail
            > Sent from Bangalore, KA, India
            > Charles de
            > Gaulle<http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html>
            > - "The better I get to know men, the more I find myself loving dogs."
            >
            >
            > [Non-text portions of this message have been removed]
            >
            >
            >
            > ------------------------------------
            >
            > Yahoo! Groups Links
            >
            >
            >
          • ☺Aνιηαѕн ∂єѕαι™☺
            Hi John I will select Accoding to VID of a table I missed that Column Where VID is Foreign Key Select * from Table where VID=@VID Totally my table has Id
            Message 5 of 19 , Dec 27, 2009
              Hi
              John

              I will select Accoding to VID of a table

              I missed that Column Where VID is Foreign Key

              Select * from Table where VID=@VID

              Totally my table has

              Id Int(Auto increment)
              Vid Foreign Key
              Value Decimal
              Description Text
              Type Text

              Thanks for reply :)





              On Sun, Dec 27, 2009 at 6:44 AM, John Warner <john@...> wrote:

              >
              >
              > Read the question carefully below, if you don't understand part of it, ask.
              > Your reply has nothing to do with my question. I cannot help you if you will
              > not help me. Notice the part about DO NOT WORRY ABOUT COUNTING H RIGHT NOW.
              > That last part is critical.
              >
              >
              > Given what you have shown us, could you show me a SELECT that gets only
              > the second row (don't worry about counting H right now). Sort of:
              > SELECT *
              > FROM table
              > WHERE ?????
              >
              > John Warner
              >
              > > -----Original Message-----
              > > From: SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
              > > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>]
              > On Behalf Of ?A???a??
              > > ???a?�?
              > > Sent: Sunday, December 27, 2009 9:34 AM
              > > To: SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
              > > Subject: Re: [SQLQueriesNoCode] Query forcount
              > >
              > > Hi John see if i query
              > >
              > > Select * from Table it has to show me that up to dat row how many times H
              > > appeared. Dats it :)
              > >
              > > In where condition i will add where Id =Value
              > >
              > > On Sun, Dec 27, 2009 at 6:31 AM, John Warner <john@...<john%40jwarner.com>>
              > wrote:
              > >
              > > >
              > > >
              > > > Given what you have shown us, could you show me a SELECT that gets
              > > only
              > > > the second row (don't worry about counting H right now. Sort of:
              > > > SELECT *
              > > > FROM table
              > > > WHERE ?????
              > > >
              > > > John Warner
              > > >
              > > >
              > > > > -----Original Message-----
              > > > > From:
              > > SQLQueriesNoCode@yahoogroups.com <SQLQueriesNoCode%40yahoogroups.com>
              > <SQLQueriesNoCode%40yahoogrou
              > > ps.com>
              > > > >
              > > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
              > <SQLQueriesNoCode%40yah
              > > oogroups.com>]
              > > > On Behalf Of ?A???a??
              > > > > ???a?T?
              > > > > Sent: Sunday, December 27, 2009 8:46 AM
              > > > > To: SQL Code group
              > > > > Subject: [SQLQueriesNoCode] Query forcount
              > > > >
              > > > > Hi
              > > > >
              > > > > I have a Table
              > > > >
              > > > > Table1 where it has columns like
              > > > >
              > > > > *Column Data Type*
              > > > > Id Int(Auto increment)
              > > > > Value Decimal
              > > > > Description Text
              > > > > Type Text
              > > > >
              > > > > Data which i insert will be like this
              > > > >
              > > > > Value Description Type
              > > > >
              > > > > 0.00 Loss H
              > > > > 45.3 Loss U
              > > > > 12.3 Loss U
              > > > > 12.3 Loss U
              > > > > 12.3 Loss H
              > > > > 12.3 Loss U
              > > > > 12.3 Loss U
              > > > >
              > > > >
              > > > > I just want to get the Count of the H for each row
              > > > >
              > > > > So if i query something where i need to get how many Type H Gone
              > before
              > > > this
              > > > > row..
              > > > >
              > > > >
              > > > > For example when the second row fetched i need to get 1
              > > > >
              > > > > If i get last row output i need to get 2
              > > > >
              > > > > Upto dat row H are 2 so . how to get like this . please help me in
              > this
              > > > >
              > > > > --
              > > > > Thanks & Regards
              > > > > Avinash Desai
              > > > > *SAVE Nature SAVE Tree SAVE*
              > > > >
              > > > > Think Before you print: Please consider our environment before
              > printing
              > > > this
              > > > > e-mail
              > > > >
              > > > > Ogden Nash
              > > > > <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
              > > >
              > > > > "The trouble with a kitten is that when it grows up, it's always a
              > cat."
              > > > >
              > > > >
              > > > > [Non-text portions of this message have been removed]
              > > > >
              > > > >
              > > > >
              > > > > ------------------------------------
              > > > >
              > > > > Yahoo! Groups Links
              > > > >
              > > > >
              > > > >
              > > >
              > > >
              > > >
              > >
              > >
              > >
              > > --
              >
              > > Thanks & Regards
              > > Avinash Desai
              > > *SAVE Nature SAVE Tree SAVE*
              > >
              > > Think Before you print: Please consider our environment before printing
              > this
              > > e-mail
              > > Sent from Bangalore, KA, India
              > > Charles de
              > > Gaulle<
              > http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html>
              >
              > > - "The better I get to know men, the more I find myself loving dogs."
              > >
              > >
              > > [Non-text portions of this message have been removed]
              > >
              > >
              > >
              > > ------------------------------------
              > >
              > > Yahoo! Groups Links
              > >
              > >
              > >
              >
              >
              >



              --
              Thanks & Regards
              Avinash Desai
              *SAVE Nature SAVE Tree SAVE*

              Think Before you print: Please consider our environment before printing this
              e-mail
              Sent from Bangalore, KA, India
              Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> -
              "Sports is like a war without the killing."


              [Non-text portions of this message have been removed]
            • John Warner
              Where did VID come from? In your first post there was no such column in the table. How would you know @VID is calling for the second row and not the 10th row?
              Message 6 of 19 , Dec 27, 2009
                Where did VID come from? In your first post there was no such column in the table. How would you know @VID is calling for the second row and not the 10th row?

                What is the assignment your instructor gave you? Are there anymore secret columns in this table?
                What does the Table where VID is the primary key look like?

                John Warner


                > -----Original Message-----
                > From: SQLQueriesNoCode@yahoogroups.com
                > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of ?A???a??
                > ???a?™?
                > Sent: Sunday, December 27, 2009 9:48 AM
                > To: SQLQueriesNoCode@yahoogroups.com
                > Subject: Re: [SQLQueriesNoCode] Query forcount
                >
                > Hi
                > John
                >
                > I will select Accoding to VID of a table
                >
                > I missed that Column Where VID is Foreign Key
                >
                > Select * from Table where VID=@VID
                >
                > Totally my table has
                >
                > Id Int(Auto increment)
                > Vid Foreign Key
                > Value Decimal
                > Description Text
                > Type Text
                >
                > Thanks for reply :)
                >
                >
                >
                >
                >
                > On Sun, Dec 27, 2009 at 6:44 AM, John Warner <john@...> wrote:
                >
                > >
                > >
                > > Read the question carefully below, if you don't understand part of it, ask.
                > > Your reply has nothing to do with my question. I cannot help you if you will
                > > not help me. Notice the part about DO NOT WORRY ABOUT COUNTING H
                > RIGHT NOW.
                > > That last part is critical.
                > >
                > >
                > > Given what you have shown us, could you show me a SELECT that gets
                > only
                > > the second row (don't worry about counting H right now). Sort of:
                > > SELECT *
                > > FROM table
                > > WHERE ?????
                > >
                > > John Warner
                > >
                > > > -----Original Message-----
                > > > From:
                > SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogrou
                > ps.com>
                > > >
                > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yah
                > oogroups.com>]
                > > On Behalf Of ?A???a??
                > > > ???a?�?
                > > > Sent: Sunday, December 27, 2009 9:34 AM
                > > > To:
                > SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogrou
                > ps.com>
                > > > Subject: Re: [SQLQueriesNoCode] Query forcount
                > > >
                > > > Hi John see if i query
                > > >
                > > > Select * from Table it has to show me that up to dat row how many times H
                > > > appeared. Dats it :)
                > > >
                > > > In where condition i will add where Id =Value
                > > >
                > > > On Sun, Dec 27, 2009 at 6:31 AM, John Warner
                > <john@...<john%40jwarner.com>>
                > > wrote:
                > > >
                > > > >
                > > > >
                > > > > Given what you have shown us, could you show me a SELECT that gets
                > > > only
                > > > > the second row (don't worry about counting H right now. Sort of:
                > > > > SELECT *
                > > > > FROM table
                > > > > WHERE ?????
                > > > >
                > > > > John Warner
                > > > >
                > > > >
                > > > > > -----Original Message-----
                > > > > > From:
                > > > SQLQueriesNoCode@yahoogroups.com
                > <SQLQueriesNoCode%40yahoogroups.com>
                > > <SQLQueriesNoCode%40yahoogrou
                > > > ps.com>
                > > > > >
                > > >
                > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yah
                > oogroups.com>
                > > <SQLQueriesNoCode%40yah
                > > > oogroups.com>]
                > > > > On Behalf Of ?A???a??
                > > > > > ???a?T?
                > > > > > Sent: Sunday, December 27, 2009 8:46 AM
                > > > > > To: SQL Code group
                > > > > > Subject: [SQLQueriesNoCode] Query forcount
                > > > > >
                > > > > > Hi
                > > > > >
                > > > > > I have a Table
                > > > > >
                > > > > > Table1 where it has columns like
                > > > > >
                > > > > > *Column Data Type*
                > > > > > Id Int(Auto increment)
                > > > > > Value Decimal
                > > > > > Description Text
                > > > > > Type Text
                > > > > >
                > > > > > Data which i insert will be like this
                > > > > >
                > > > > > Value Description Type
                > > > > >
                > > > > > 0.00 Loss H
                > > > > > 45.3 Loss U
                > > > > > 12.3 Loss U
                > > > > > 12.3 Loss U
                > > > > > 12.3 Loss H
                > > > > > 12.3 Loss U
                > > > > > 12.3 Loss U
                > > > > >
                > > > > >
                > > > > > I just want to get the Count of the H for each row
                > > > > >
                > > > > > So if i query something where i need to get how many Type H Gone
                > > before
                > > > > this
                > > > > > row..
                > > > > >
                > > > > >
                > > > > > For example when the second row fetched i need to get 1
                > > > > >
                > > > > > If i get last row output i need to get 2
                > > > > >
                > > > > > Upto dat row H are 2 so . how to get like this . please help me in
                > > this
                > > > > >
                > > > > > --
                > > > > > Thanks & Regards
                > > > > > Avinash Desai
                > > > > > *SAVE Nature SAVE Tree SAVE*
                > > > > >
                > > > > > Think Before you print: Please consider our environment before
                > > printing
                > > > > this
                > > > > > e-mail
                > > > > >
                > > > > > Ogden Nash
                > > > > > <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
                > > > >
                > > > > > "The trouble with a kitten is that when it grows up, it's always a
                > > cat."
                > > > > >
                > > > > >
                > > > > > [Non-text portions of this message have been removed]
                > > > > >
                > > > > >
                > > > > >
                > > > > > ------------------------------------
                > > > > >
                > > > > > Yahoo! Groups Links
                > > > > >
                > > > > >
                > > > > >
                > > > >
                > > > >
                > > > >
                > > >
                > > >
                > > >
                > > > --
                > >
                > > > Thanks & Regards
                > > > Avinash Desai
                > > > *SAVE Nature SAVE Tree SAVE*
                > > >
                > > > Think Before you print: Please consider our environment before printing
                > > this
                > > > e-mail
                > > > Sent from Bangalore, KA, India
                > > > Charles de
                > > > Gaulle<
                > > http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html>
                > >
                > > > - "The better I get to know men, the more I find myself loving dogs."
                > > >
                > > >
                > > > [Non-text portions of this message have been removed]
                > > >
                > > >
                > > >
                > > > ------------------------------------
                > > >
                > > > Yahoo! Groups Links
                > > >
                > > >
                > > >
                > >
                > >
                > >
                >
                >
                >
                > --
                > Thanks & Regards
                > Avinash Desai
                > *SAVE Nature SAVE Tree SAVE*
                >
                > Think Before you print: Please consider our environment before printing this
                > e-mail
                > Sent from Bangalore, KA, India
                > Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> -
                > "Sports is like a war without the killing."
                >
                >
                > [Non-text portions of this message have been removed]
                >
                >
                >
                > ------------------------------------
                >
                > Yahoo! Groups Links
                >
                >
                >
              • ☺Aνιηαѕн ∂єѕαι™☺
                Hi John Just Clear Cut *VTable* VId FromDate ToDate *Table* Id Vid Value Description Type I am querying for the Table *TABLE* where VID =@VID ok Ex: Just in
                Message 7 of 19 , Dec 27, 2009
                  Hi

                  John

                  Just Clear Cut

                  *VTable*

                  VId
                  FromDate
                  ToDate

                  *Table*
                  Id
                  Vid
                  Value
                  Description
                  Type

                  I am querying for the Table *TABLE* where VID =@VID

                  ok

                  Ex: Just in case *TABLE* has 15Rows for VID 10

                  Then when i query

                  Select * from TABLE where VID=10

                  then

                  It has to say in that 15 rows *H *has appeared this much time Ex: 7 times H
                  appeared

                  If the query is like

                  Select * from TABLE where VID=10 and Value >150


                  then also it has to say Ex: 7 times H appeared


                  I think now i made it clear.




                  On Sun, Dec 27, 2009 at 6:57 AM, John Warner <john@...> wrote:

                  >
                  >
                  > Where did VID come from? In your first post there was no such column in the
                  > table. How would you know @VID is calling for the second row and not the
                  > 10th row?
                  >
                  > What is the assignment your instructor gave you? Are there anymore secret
                  > columns in this table?
                  > What does the Table where VID is the primary key look like?
                  >
                  >
                  > John Warner
                  >
                  > > -----Original Message-----
                  > > From: SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
                  > > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>]
                  > On Behalf Of ?A???a??
                  > > ???a?™?
                  > > Sent: Sunday, December 27, 2009 9:48 AM
                  > > To: SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
                  > > Subject: Re: [SQLQueriesNoCode] Query forcount
                  > >
                  > > Hi
                  > > John
                  > >
                  > > I will select Accoding to VID of a table
                  > >
                  > > I missed that Column Where VID is Foreign Key
                  > >
                  > > Select * from Table where VID=@VID
                  > >
                  > > Totally my table has
                  > >
                  > > Id Int(Auto increment)
                  > > Vid Foreign Key
                  > > Value Decimal
                  > > Description Text
                  > > Type Text
                  > >
                  > > Thanks for reply :)
                  > >
                  > >
                  > >
                  > >
                  > >
                  > > On Sun, Dec 27, 2009 at 6:44 AM, John Warner <john@...<john%40jwarner.com>>
                  > wrote:
                  > >
                  > > >
                  > > >
                  > > > Read the question carefully below, if you don't understand part of it,
                  > ask.
                  > > > Your reply has nothing to do with my question. I cannot help you if you
                  > will
                  > > > not help me. Notice the part about DO NOT WORRY ABOUT COUNTING H
                  > > RIGHT NOW.
                  > > > That last part is critical.
                  > > >
                  > > >
                  > > > Given what you have shown us, could you show me a SELECT that gets
                  > > only
                  > > > the second row (don't worry about counting H right now). Sort of:
                  > > > SELECT *
                  > > > FROM table
                  > > > WHERE ?????
                  > > >
                  > > > John Warner
                  > > >
                  > > > > -----Original Message-----
                  > > > > From:
                  > > SQLQueriesNoCode@yahoogroups.com <SQLQueriesNoCode%40yahoogroups.com>
                  > <SQLQueriesNoCode%40yahoogrou
                  > > ps.com>
                  > > > >
                  > > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
                  > <SQLQueriesNoCode%40yah
                  > > oogroups.com>]
                  > > > On Behalf Of ?A???a??
                  > > > > ???a?�?
                  > > > > Sent: Sunday, December 27, 2009 9:34 AM
                  > > > > To:
                  > > SQLQueriesNoCode@yahoogroups.com <SQLQueriesNoCode%40yahoogroups.com>
                  > <SQLQueriesNoCode%40yahoogrou
                  >
                  > > ps.com>
                  > > > > Subject: Re: [SQLQueriesNoCode] Query forcount
                  > > > >
                  > > > > Hi John see if i query
                  > > > >
                  > > > > Select * from Table it has to show me that up to dat row how many
                  > times H
                  > > > > appeared. Dats it :)
                  > > > >
                  > > > > In where condition i will add where Id =Value
                  > > > >
                  > > > > On Sun, Dec 27, 2009 at 6:31 AM, John Warner
                  > > <john@... <john%40jwarner.com><john%40jwarner.com>>
                  >
                  > > > wrote:
                  > > > >
                  > > > > >
                  > > > > >
                  > > > > > Given what you have shown us, could you show me a SELECT that gets
                  > > > > only
                  > > > > > the second row (don't worry about counting H right now. Sort of:
                  > > > > > SELECT *
                  > > > > > FROM table
                  > > > > > WHERE ?????
                  > > > > >
                  > > > > > John Warner
                  > > > > >
                  > > > > >
                  > > > > > > -----Original Message-----
                  > > > > > > From:
                  > > > > SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
                  > > <SQLQueriesNoCode%40yahoogroups.com>
                  > > > <SQLQueriesNoCode%40yahoogrou
                  > > > > ps.com>
                  > > > > > >
                  > > > >
                  > > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogroups.com>
                  > <SQLQueriesNoCode%40yah
                  > > oogroups.com>
                  > > > <SQLQueriesNoCode%40yah
                  > > > > oogroups.com>]
                  > > > > > On Behalf Of ?A???a??
                  > > > > > > ???a?T?
                  > > > > > > Sent: Sunday, December 27, 2009 8:46 AM
                  > > > > > > To: SQL Code group
                  > > > > > > Subject: [SQLQueriesNoCode] Query forcount
                  > > > > > >
                  > > > > > > Hi
                  > > > > > >
                  > > > > > > I have a Table
                  > > > > > >
                  > > > > > > Table1 where it has columns like
                  > > > > > >
                  > > > > > > *Column Data Type*
                  > > > > > > Id Int(Auto increment)
                  > > > > > > Value Decimal
                  > > > > > > Description Text
                  > > > > > > Type Text
                  > > > > > >
                  > > > > > > Data which i insert will be like this
                  > > > > > >
                  > > > > > > Value Description Type
                  > > > > > >
                  > > > > > > 0.00 Loss H
                  > > > > > > 45.3 Loss U
                  > > > > > > 12.3 Loss U
                  > > > > > > 12.3 Loss U
                  > > > > > > 12.3 Loss H
                  > > > > > > 12.3 Loss U
                  > > > > > > 12.3 Loss U
                  > > > > > >
                  > > > > > >
                  > > > > > > I just want to get the Count of the H for each row
                  > > > > > >
                  > > > > > > So if i query something where i need to get how many Type H Gone
                  > > > before
                  > > > > > this
                  > > > > > > row..
                  > > > > > >
                  > > > > > >
                  > > > > > > For example when the second row fetched i need to get 1
                  > > > > > >
                  > > > > > > If i get last row output i need to get 2
                  > > > > > >
                  > > > > > > Upto dat row H are 2 so . how to get like this . please help me
                  > in
                  > > > this
                  > > > > > >
                  > > > > > > --
                  > > > > > > Thanks & Regards
                  > > > > > > Avinash Desai
                  > > > > > > *SAVE Nature SAVE Tree SAVE*
                  > > > > > >
                  > > > > > > Think Before you print: Please consider our environment before
                  > > > printing
                  > > > > > this
                  > > > > > > e-mail
                  > > > > > >
                  > > > > > > Ogden Nash
                  > > > > > > <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> -
                  > > > > >
                  > > > > > > "The trouble with a kitten is that when it grows up, it's always
                  > a
                  > > > cat."
                  > > > > > >
                  > > > > > >
                  > > > > > > [Non-text portions of this message have been removed]
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > > ------------------------------------
                  > > > > > >
                  > > > > > > Yahoo! Groups Links
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > >
                  > > > > >
                  > > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > > --
                  > > >
                  > > > > Thanks & Regards
                  > > > > Avinash Desai
                  > > > > *SAVE Nature SAVE Tree SAVE*
                  > > > >
                  > > > > Think Before you print: Please consider our environment before
                  > printing
                  > > > this
                  > > > > e-mail
                  > > > > Sent from Bangalore, KA, India
                  > > > > Charles de
                  > > > > Gaulle<
                  > > > http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html>
                  > > >
                  > > > > - "The better I get to know men, the more I find myself loving dogs."
                  > > > >
                  > > > >
                  > > > > [Non-text portions of this message have been removed]
                  > > > >
                  > > > >
                  > > > >
                  > > > > ------------------------------------
                  > > > >
                  > > > > Yahoo! Groups Links
                  > > > >
                  > > > >
                  > > > >
                  > > >
                  > > >
                  > > >
                  > >
                  > >
                  > >
                  > > --
                  >
                  > > Thanks & Regards
                  > > Avinash Desai
                  > > *SAVE Nature SAVE Tree SAVE*
                  > >
                  > > Think Before you print: Please consider our environment before printing
                  > this
                  > > e-mail
                  > > Sent from Bangalore, KA, India
                  > > Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html>
                  > -
                  >
                  > > "Sports is like a war without the killing."
                  > >
                  > >
                  > > [Non-text portions of this message have been removed]
                  > >
                  > >
                  > >
                  > > ------------------------------------
                  > >
                  > > Yahoo! Groups Links
                  > >
                  > >
                  > >
                  >
                  >
                  >



                  --
                  Thanks & Regards
                  Avinash Desai
                  *SAVE Nature SAVE Tree SAVE*

                  Think Before you print: Please consider our environment before printing this
                  e-mail
                  Sent from Bangalore, KA, India
                  Stephen Leacock<http://www.brainyquote.com/quotes/authors/s/stephen_leacock.html>
                  - "I detest life-insurance agents: they always argue that I shall some
                  day
                  die, which is not so."


                  [Non-text portions of this message have been removed]
                • John Warner
                  The result you want cannot happen with the information provided. John Warner
                  Message 8 of 19 , Dec 27, 2009
                    The result you want cannot happen with the information provided.

                    John Warner


                    > -----Original Message-----
                    > From: SQLQueriesNoCode@yahoogroups.com
                    > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of ?A???a??
                    > ???a?™?
                    > Sent: Sunday, December 27, 2009 10:04 AM
                    > To: SQLQueriesNoCode@yahoogroups.com
                    > Subject: Re: [SQLQueriesNoCode] Query forcount
                    >
                    > Hi
                    >
                    > John
                    >
                    > Just Clear Cut
                    >
                    > *VTable*
                    >
                    > VId
                    > FromDate
                    > ToDate
                    >
                    > *Table*
                    > Id
                    > Vid
                    > Value
                    > Description
                    > Type
                    >
                    > I am querying for the Table *TABLE* where VID =@VID
                    >
                    > ok
                    >
                    > Ex: Just in case *TABLE* has 15Rows for VID 10
                    >
                    > Then when i query
                    >
                    > Select * from TABLE where VID=10
                    >
                    > then
                    >
                    > It has to say in that 15 rows *H *has appeared this much time Ex: 7 times H
                    > appeared
                    >
                    > If the query is like
                    >
                    > Select * from TABLE where VID=10 and Value >150
                    >
                    >
                    > then also it has to say Ex: 7 times H appeared
                    >
                    >
                    > I think now i made it clear.
                    >
                    >
                    >
                    >
                    > On Sun, Dec 27, 2009 at 6:57 AM, John Warner <john@...> wrote:
                    >
                    > >
                    > >
                    > > Where did VID come from? In your first post there was no such column in the
                    > > table. How would you know @VID is calling for the second row and not the
                    > > 10th row?
                    > >
                    > > What is the assignment your instructor gave you? Are there anymore secret
                    > > columns in this table?
                    > > What does the Table where VID is the primary key look like?
                    > >
                    > >
                    > > John Warner
                    > >
                    > > > -----Original Message-----
                    > > > From:
                    > SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogrou
                    > ps.com>
                    > > >
                    > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yah
                    > oogroups.com>]
                    > > On Behalf Of ?A???a??
                    > > > ???a?™?
                    > > > Sent: Sunday, December 27, 2009 9:48 AM
                    > > > To:
                    > SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogrou
                    > ps.com>
                    > > > Subject: Re: [SQLQueriesNoCode] Query forcount
                    > > >
                    > > > Hi
                    > > > John
                    > > >
                    > > > I will select Accoding to VID of a table
                    > > >
                    > > > I missed that Column Where VID is Foreign Key
                    > > >
                    > > > Select * from Table where VID=@VID
                    > > >
                    > > > Totally my table has
                    > > >
                    > > > Id Int(Auto increment)
                    > > > Vid Foreign Key
                    > > > Value Decimal
                    > > > Description Text
                    > > > Type Text
                    > > >
                    > > > Thanks for reply :)
                    > > >
                    > > >
                    > > >
                    > > >
                    > > >
                    > > > On Sun, Dec 27, 2009 at 6:44 AM, John Warner
                    > <john@...<john%40jwarner.com>>
                    > > wrote:
                    > > >
                    > > > >
                    > > > >
                    > > > > Read the question carefully below, if you don't understand part of it,
                    > > ask.
                    > > > > Your reply has nothing to do with my question. I cannot help you if you
                    > > will
                    > > > > not help me. Notice the part about DO NOT WORRY ABOUT
                    > COUNTING H
                    > > > RIGHT NOW.
                    > > > > That last part is critical.
                    > > > >
                    > > > >
                    > > > > Given what you have shown us, could you show me a SELECT that gets
                    > > > only
                    > > > > the second row (don't worry about counting H right now). Sort of:
                    > > > > SELECT *
                    > > > > FROM table
                    > > > > WHERE ?????
                    > > > >
                    > > > > John Warner
                    > > > >
                    > > > > > -----Original Message-----
                    > > > > > From:
                    > > > SQLQueriesNoCode@yahoogroups.com
                    > <SQLQueriesNoCode%40yahoogroups.com>
                    > > <SQLQueriesNoCode%40yahoogrou
                    > > > ps.com>
                    > > > > >
                    > > >
                    > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yah
                    > oogroups.com>
                    > > <SQLQueriesNoCode%40yah
                    > > > oogroups.com>]
                    > > > > On Behalf Of ?A???a??
                    > > > > > ???a?�?
                    > > > > > Sent: Sunday, December 27, 2009 9:34 AM
                    > > > > > To:
                    > > > SQLQueriesNoCode@yahoogroups.com
                    > <SQLQueriesNoCode%40yahoogroups.com>
                    > > <SQLQueriesNoCode%40yahoogrou
                    > >
                    > > > ps.com>
                    > > > > > Subject: Re: [SQLQueriesNoCode] Query forcount
                    > > > > >
                    > > > > > Hi John see if i query
                    > > > > >
                    > > > > > Select * from Table it has to show me that up to dat row how many
                    > > times H
                    > > > > > appeared. Dats it :)
                    > > > > >
                    > > > > > In where condition i will add where Id =Value
                    > > > > >
                    > > > > > On Sun, Dec 27, 2009 at 6:31 AM, John Warner
                    > > > <john@... <john%40jwarner.com><john%40jwarner.com>>
                    > >
                    > > > > wrote:
                    > > > > >
                    > > > > > >
                    > > > > > >
                    > > > > > > Given what you have shown us, could you show me a SELECT that
                    > gets
                    > > > > > only
                    > > > > > > the second row (don't worry about counting H right now. Sort of:
                    > > > > > > SELECT *
                    > > > > > > FROM table
                    > > > > > > WHERE ?????
                    > > > > > >
                    > > > > > > John Warner
                    > > > > > >
                    > > > > > >
                    > > > > > > > -----Original Message-----
                    > > > > > > > From:
                    > > > > >
                    > SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yahoogrou
                    > ps.com>
                    > > > <SQLQueriesNoCode%40yahoogroups.com>
                    > > > > <SQLQueriesNoCode%40yahoogrou
                    > > > > > ps.com>
                    > > > > > > >
                    > > > > >
                    > > >
                    > [mailto:SQLQueriesNoCode@yahoogroups.com<SQLQueriesNoCode%40yah
                    > oogroups..com>
                    > > <SQLQueriesNoCode%40yah
                    > > > oogroups.com>
                    > > > > <SQLQueriesNoCode%40yah
                    > > > > > oogroups.com>]
                    > > > > > > On Behalf Of ?A???a??
                    > > > > > > > ???a?T?
                    > > > > > > > Sent: Sunday, December 27, 2009 8:46 AM
                    > > > > > > > To: SQL Code group
                    > > > > > > > Subject: [SQLQueriesNoCode] Query forcount
                    > > > > > > >
                    > > > > > > > Hi
                    > > > > > > >
                    > > > > > > > I have a Table
                    > > > > > > >
                    > > > > > > > Table1 where it has columns like
                    > > > > > > >
                    > > > > > > > *Column Data Type*
                    > > > > > > > Id Int(Auto increment)
                    > > > > > > > Value Decimal
                    > > > > > > > Description Text
                    > > > > > > > Type Text
                    > > > > > > >
                    > > > > > > > Data which i insert will be like this
                    > > > > > > >
                    > > > > > > > Value Description Type
                    > > > > > > >
                    > > > > > > > 0.00 Loss H
                    > > > > > > > 45.3 Loss U
                    > > > > > > > 12.3 Loss U
                    > > > > > > > 12.3 Loss U
                    > > > > > > > 12.3 Loss H
                    > > > > > > > 12.3 Loss U
                    > > > > > > > 12.3 Loss U
                    > > > > > > >
                    > > > > > > >
                    > > > > > > > I just want to get the Count of the H for each row
                    > > > > > > >
                    > > > > > > > So if i query something where i need to get how many Type H
                    > Gone
                    > > > > before
                    > > > > > > this
                    > > > > > > > row..
                    > > > > > > >
                    > > > > > > >
                    > > > > > > > For example when the second row fetched i need to get 1
                    > > > > > > >
                    > > > > > > > If i get last row output i need to get 2
                    > > > > > > >
                    > > > > > > > Upto dat row H are 2 so . how to get like this . please help me
                    > > in
                    > > > > this
                    > > > > > > >
                    > > > > > > > --
                    > > > > > > > Thanks & Regards
                    > > > > > > > Avinash Desai
                    > > > > > > > *SAVE Nature SAVE Tree SAVE*
                    > > > > > > >
                    > > > > > > > Think Before you print: Please consider our environment before
                    > > > > printing
                    > > > > > > this
                    > > > > > > > e-mail
                    > > > > > > >
                    > > > > > > > Ogden Nash
                    > > > > > > > <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html>
                    > -
                    > > > > > >
                    > > > > > > > "The trouble with a kitten is that when it grows up, it's always
                    > > a
                    > > > > cat."
                    > > > > > > >
                    > > > > > > >
                    > > > > > > > [Non-text portions of this message have been removed]
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > > ------------------------------------
                    > > > > > > >
                    > > > > > > > Yahoo! Groups Links
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > >
                    > > > > > >
                    > > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > > --
                    > > > >
                    > > > > > Thanks & Regards
                    > > > > > Avinash Desai
                    > > > > > *SAVE Nature SAVE Tree SAVE*
                    > > > > >
                    > > > > > Think Before you print: Please consider our environment before
                    > > printing
                    > > > > this
                    > > > > > e-mail
                    > > > > > Sent from Bangalore, KA, India
                    > > > > > Charles de
                    > > > > > Gaulle<
                    > > > > http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html>
                    > > > >
                    > > > > > - "The better I get to know men, the more I find myself loving dogs.."
                    > > > > >
                    > > > > >
                    > > > > > [Non-text portions of this message have been removed]
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > > ------------------------------------
                    > > > > >
                    > > > > > Yahoo! Groups Links
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > >
                    > > >
                    > > >
                    > > > --
                    > >
                    > > > Thanks & Regards
                    > > > Avinash Desai
                    > > > *SAVE Nature SAVE Tree SAVE*
                    > > >
                    > > > Think Before you print: Please consider our environment before printing
                    > > this
                    > > > e-mail
                    > > > Sent from Bangalore, KA, India
                    > > > Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html>
                    > > -
                    > >
                    > > > "Sports is like a war without the killing."
                    > > >
                    > > >
                    > > > [Non-text portions of this message have been removed]
                    > > >
                    > > >
                    > > >
                    > > > ------------------------------------
                    > > >
                    > > > Yahoo! Groups Links
                    > > >
                    > > >
                    > > >
                    > >
                    > >
                    > >
                    >
                    >
                    >
                    > --
                    > Thanks & Regards
                    > Avinash Desai
                    > *SAVE Nature SAVE Tree SAVE*
                    >
                    > Think Before you print: Please consider our environment before printing this
                    > e-mail
                    > Sent from Bangalore, KA, India
                    > Stephen
                    > Leacock<http://www.brainyquote.com/quotes/authors/s/stephen_leacock..html
                    > >
                    > - "I detest life-insurance agents: they always argue that I shall some
                    > day
                    > die, which is not so."
                    >
                    >
                    > [Non-text portions of this message have been removed]
                    >
                    >
                    >
                    > ------------------------------------
                    >
                    > Yahoo! Groups Links
                    >
                    >
                    >
                  • Rob Richardson
                    One fundamental problem you have is that in a database, there is no concept of before . If you don t have an ORDER BY clause in your query, you have no
                    Message 9 of 19 , Dec 29, 2009
                      One fundamental problem you have is that in a database, there is no
                      concept of "before". If you don't have an ORDER BY clause in your
                      query, you have no guarantee what order your records will be given to
                      you.

                      You can get what you want easily from a reporting package such as
                      Crystal Reports, but I don't see how to do it directly in SQL. It seems
                      to me that you'd have to use a recursive subquery, and I have no idea if
                      there is such a thing.

                      Come to think of it, you could do what you want inside a stored
                      procedure that returns a table, once you define how to order your input
                      table. The procedure would create a table, walk through the original
                      table, adding a row to the new table with data from the original plus
                      the count of H, and then return the new table it created. But since
                      this group is for queries but no code, that's outside the scope of the
                      group.

                      RobR
                    • John Warner
                      I m supporting a SQL Server Express 2005 database that is actually house on a rather stout server platform though not sure why in this case it would matter. On
                      Message 10 of 19 , Jan 13, 2010
                        I'm supporting a SQL Server Express 2005 database that is actually house
                        on a rather stout server platform though not sure why in this case it
                        would matter. On several tables in the primary DB there were triggers that
                        would reach out to a Pervasive database, grab some data and do a few
                        updates based on a particular field in each specific SQL table being
                        inserted (a key field). OK the point about the middle of last week the
                        triggers seem to have just disappeared. To everyone's knowledge there was
                        not a drop trigger issued or such.

                        Has anyone heard of something like this before and does anyone know how to
                        prevent it assuming this is not user error (which I tend to think not)?

                        Thanks and sorry for being a bit off topic but trying to research the
                        problem. Also I have the code for the triggers that isn't the issue it is
                        just them disappearing that is 'alarming'.

                        John Warner
                      • Damhuis Anton
                        Hi John I have had a few situations like this before, and all but one time (as far as I can remember) was down to some *ghost* doing it. In the one situation
                        Message 11 of 19 , Jan 14, 2010
                          Hi John

                          I have had a few situations like this before, and all but one time (as far as I can remember) was down to some *ghost* doing it.
                          In the one situation it was a DB restore of a previous version which caused the triggers or stored procs to go missing.

                          Hope you find the solution / cause

                          Regards
                          Anton Damhuis

                          ________________________________
                          Please note: This email and its contents are subject to the disclaimer as displayed at the following link: http://www.investmentsolutions.co.za/EmailLegalNotice.htm. Should you not have web access, send an email to legalnotice@... and a copy of this disclaimer will be sent to you.


                          [Non-text portions of this message have been removed]
                        • p_livengood
                          I have never encountered this, but if you want to track it down (or prevent it) you could create a DDL Trigger that would fire if the triggers were altered (or
                          Message 12 of 19 , Jan 14, 2010
                            I have never encountered this, but if you want to track it down (or prevent it) you could create a DDL Trigger that would fire if the triggers were altered (or deleted) and either send an email, or stop the alteration.

                            HTH
                            Paul

                            --- In SQLQueriesNoCode@yahoogroups.com, Damhuis Anton <DamhuisA@...> wrote:
                            >
                            > Hi John
                            >
                            > I have had a few situations like this before, and all but one time (as far as I can remember) was down to some *ghost* doing it.
                            > In the one situation it was a DB restore of a previous version which caused the triggers or stored procs to go missing.
                            >
                            > Hope you find the solution / cause
                            >
                            > Regards
                            > Anton Damhuis
                            >
                            > ________________________________
                            > Please note: This email and its contents are subject to the disclaimer as displayed at the following link: http://www.investmentsolutions.co.za/EmailLegalNotice.htm. Should you not have web access, send an email to legalnotice@... and a copy of this disclaimer will be sent to you.
                            >
                            >
                            > [Non-text portions of this message have been removed]
                            >
                          • John Warner
                            Good thought, might not tell me everything but could sure alert me to something happening. Thanks Paul. (have you changed your email?) John Warner ... prevent
                            Message 13 of 19 , Jan 14, 2010
                              Good thought, might not tell me everything but could sure alert me to
                              something happening. Thanks Paul.

                              (have you changed your email?)

                              John Warner


                              > -----Original Message-----
                              > From: SQLQueriesNoCode@yahoogroups.com
                              > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of p_livengood
                              > Sent: Thursday, January 14, 2010 1:00 PM
                              > To: SQLQueriesNoCode@yahoogroups.com
                              > Subject: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                              > triggers ??
                              >
                              > I have never encountered this, but if you want to track it down (or
                              prevent it)
                              > you could create a DDL Trigger that would fire if the triggers were
                              altered (or
                              > deleted) and either send an email, or stop the alteration.
                              >
                              > HTH
                              > Paul
                              >
                              > --- In SQLQueriesNoCode@yahoogroups.com, Damhuis Anton
                              > <DamhuisA@...> wrote:
                              > >
                              > > Hi John
                              > >
                              > > I have had a few situations like this before, and all but one time (as
                              far as I
                              > can remember) was down to some *ghost* doing it.
                              > > In the one situation it was a DB restore of a previous version which
                              caused
                              > the triggers or stored procs to go missing.
                              > >
                              > > Hope you find the solution / cause
                              > >
                              > > Regards
                              > > Anton Damhuis
                              > >
                              > > ________________________________
                              > > Please note: This email and its contents are subject to the disclaimer
                              as
                              > displayed at the following link:
                              > http://www.investmentsolutions.co.za/EmailLegalNotice.htm. Should you
                              not
                              > have web access, send an email to legalnotice@... and a copy of this
                              > disclaimer will be sent to you.
                              > >
                              > >
                              > > [Non-text portions of this message have been removed]
                              > >
                              >
                              >
                              >
                              >
                              > ------------------------------------
                              >
                              > Yahoo! Groups Links
                              >
                              >
                              >
                            • Arnie Rowland
                              John, Triggers don t just disappear . As suggested, either a backup prior to the trigger creation is being restored, or they are being removed. Removal would
                              Message 14 of 19 , Jan 14, 2010
                                John,

                                Triggers don't 'just disappear'. As suggested, either a backup prior to
                                the trigger creation is being restored, or they are being removed.

                                Removal would occur if the tables are dropped and recreated -which isn't
                                a far-fetched concept in some situations.

                                Creating a DDL event to either rollback or just log table changes sould
                                give you useful information.

                                Regards,

                                Arnie Rowland, MVP (SQL Server)

                                "You cannot do a kindness too soon because you never know how soon it
                                will be too late."
                                -Ralph Waldo Emerson




                                -----Original Message-----
                                From: SQLQueriesNoCode@yahoogroups.com
                                [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of John Warner
                                Sent: Thursday, January 14, 2010 10:28 AM
                                To: Arnie
                                Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                triggers ??

                                Good thought, might not tell me everything but could sure alert me to
                                something happening. Thanks Paul.

                                (have you changed your email?)

                                John Warner


                                > -----Original Message-----
                                > From: SQLQueriesNoCode@yahoogroups.com
                                > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of p_livengood
                                > Sent: Thursday, January 14, 2010 1:00 PM
                                > To: SQLQueriesNoCode@yahoogroups.com
                                > Subject: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                > triggers ??
                                >
                                > I have never encountered this, but if you want to track it down (or
                                prevent it)
                                > you could create a DDL Trigger that would fire if the triggers were
                                altered (or
                                > deleted) and either send an email, or stop the alteration.
                                >
                                > HTH
                                > Paul
                                >
                                > --- In SQLQueriesNoCode@yahoogroups.com, Damhuis Anton
                                > <DamhuisA@...> wrote:
                                > >
                                > > Hi John
                                > >
                                > > I have had a few situations like this before, and all but one time
                                (as
                                far as I
                                > can remember) was down to some *ghost* doing it.
                                > > In the one situation it was a DB restore of a previous version which
                                caused
                                > the triggers or stored procs to go missing.
                                > >
                                > > Hope you find the solution / cause
                                > >
                                > > Regards
                                > > Anton Damhuis
                                > >
                                > > ________________________________
                                > > Please note: This email and its contents are subject to the
                                disclaimer
                                as
                                > displayed at the following link:
                                > http://www.investmentsolutions.co.za/EmailLegalNotice.htm. Should you
                                not
                                > have web access, send an email to legalnotice@... and a copy of this
                                > disclaimer will be sent to you.
                                > >
                                > >
                                > > [Non-text portions of this message have been removed]
                                > >
                                >
                                >
                                >
                                >
                                > ------------------------------------
                                >
                                > Yahoo! Groups Links
                                >
                                >
                                >



                                ------------------------------------

                                Yahoo! Groups Links







                                __________ Information from ESET Smart Security, version of virus
                                signature database 4772 (20100114) __________

                                The message was checked by ESET Smart Security.

                                http://www.eset.com



                                __________ Information from ESET Smart Security, version of virus
                                signature database 4772 (20100114) __________

                                The message was checked by ESET Smart Security.

                                http://www.eset.com



                                Disclaimer - January 14, 2010
                                This email and any files transmitted with it are confidential and intended solely for SQLQueriesNoCode@yahoogroups.com. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of Westwood Consulting, Inc. Warning: Although Westwood Consulting, Inc has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.
                                This disclaimer was added by Policy Patrol: http://www.policypatrol.com/
                              • John Warner
                                Arnie, how would an event/trigger to detect a trigger changing/being removed work? What I mean is, I really don t know how to begin coding something like this.
                                Message 15 of 19 , Jan 14, 2010
                                  Arnie, how would an event/trigger to detect a trigger changing/being
                                  removed work? What I mean is, I really don't know how to begin coding
                                  something like this. Not asking you to do it as I learn nothing that way
                                  but what objects am I looking for, that sort of thing?

                                  Thanks to both you and Paul.

                                  John Warner


                                  > -----Original Message-----
                                  > From: SQLQueriesNoCode@yahoogroups.com
                                  > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Arnie Rowland
                                  > Sent: Thursday, January 14, 2010 1:43 PM
                                  > To: SQLQueriesNoCode@yahoogroups.com
                                  > Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                  > triggers ??
                                  >
                                  > John,
                                  >
                                  > Triggers don't 'just disappear'. As suggested, either a backup prior to
                                  > the trigger creation is being restored, or they are being removed.
                                  >
                                  > Removal would occur if the tables are dropped and recreated -which isn't
                                  > a far-fetched concept in some situations.
                                  >
                                  > Creating a DDL event to either rollback or just log table changes sould
                                  > give you useful information.
                                  >
                                  > Regards,
                                  >
                                  > Arnie Rowland, MVP (SQL Server)
                                  >
                                  > "You cannot do a kindness too soon because you never know how soon it
                                  > will be too late."
                                  > -Ralph Waldo Emerson
                                  >
                                  >
                                  >
                                  >
                                  > -----Original Message-----
                                  > From: SQLQueriesNoCode@yahoogroups.com
                                  > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of John Warner
                                  > Sent: Thursday, January 14, 2010 10:28 AM
                                  > To: Arnie
                                  > Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                  > triggers ??
                                  >
                                  > Good thought, might not tell me everything but could sure alert me to
                                  > something happening. Thanks Paul.
                                  >
                                  > (have you changed your email?)
                                  >
                                  > John Warner
                                  >
                                  >
                                  > > -----Original Message-----
                                  > > From: SQLQueriesNoCode@yahoogroups.com
                                  > > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of p_livengood
                                  > > Sent: Thursday, January 14, 2010 1:00 PM
                                  > > To: SQLQueriesNoCode@yahoogroups.com
                                  > > Subject: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                  > > triggers ??
                                  > >
                                  > > I have never encountered this, but if you want to track it down (or
                                  > prevent it)
                                  > > you could create a DDL Trigger that would fire if the triggers were
                                  > altered (or
                                  > > deleted) and either send an email, or stop the alteration.
                                  > >
                                  > > HTH
                                  > > Paul
                                  > >
                                  > > --- In SQLQueriesNoCode@yahoogroups.com, Damhuis Anton
                                  > > <DamhuisA@...> wrote:
                                  > > >
                                  > > > Hi John
                                  > > >
                                  > > > I have had a few situations like this before, and all but one time
                                  > (as
                                  > far as I
                                  > > can remember) was down to some *ghost* doing it.
                                  > > > In the one situation it was a DB restore of a previous version which
                                  > caused
                                  > > the triggers or stored procs to go missing.
                                  > > >
                                  > > > Hope you find the solution / cause
                                  > > >
                                  > > > Regards
                                  > > > Anton Damhuis
                                  > > >
                                  > > > ________________________________
                                  > > > Please note: This email and its contents are subject to the
                                  > disclaimer
                                  > as
                                  > > displayed at the following link:
                                  > > http://www.investmentsolutions.co.za/EmailLegalNotice.htm. Should you
                                  > not
                                  > > have web access, send an email to legalnotice@... and a copy of this
                                  > > disclaimer will be sent to you.
                                  > > >
                                  > > >
                                  > > > [Non-text portions of this message have been removed]
                                  > > >
                                  > >
                                  > >
                                  > >
                                  > >
                                  > > ------------------------------------
                                  > >
                                  > > Yahoo! Groups Links
                                  > >
                                  > >
                                  > >
                                  >
                                  >
                                  >
                                  > ------------------------------------
                                  >
                                  > Yahoo! Groups Links
                                  >
                                  >
                                  >
                                  >
                                  >
                                  >
                                  >
                                  > __________ Information from ESET Smart Security, version of virus
                                  > signature database 4772 (20100114) __________
                                  >
                                  > The message was checked by ESET Smart Security.
                                  >
                                  > http://www.eset.com
                                  >
                                  >
                                  >
                                  > __________ Information from ESET Smart Security, version of virus
                                  > signature database 4772 (20100114) __________
                                  >
                                  > The message was checked by ESET Smart Security.
                                  >
                                  > http://www.eset.com
                                  >
                                  >
                                  >
                                  > Disclaimer - January 14, 2010
                                  > This email and any files transmitted with it are confidential and
                                  intended solely
                                  > for SQLQueriesNoCode@yahoogroups.com. If you are not the named
                                  > addressee you should not disseminate, distribute, copy or alter this
                                  email. Any
                                  > views or opinions presented in this email are solely those of the author
                                  and
                                  > might not represent those of Westwood Consulting, Inc. Warning: Although
                                  > Westwood Consulting, Inc has taken reasonable precautions to ensure no
                                  > viruses are present in this email, the company cannot accept
                                  responsibility for
                                  > any loss or damage arising from the use of this email or attachments.
                                  > This disclaimer was added by Policy Patrol: http://www.policypatrol.com/
                                  >
                                  >
                                  > ------------------------------------
                                  >
                                  > Yahoo! Groups Links
                                  >
                                  >
                                  >
                                • Arnie Rowland
                                  John, It would be something like this: (verify with BOL) CREATE TRIGGER tr_TriggerChange ON DATABASE FOR DROP_TRIGGER, ALTER_TRIGGER AS BEGIN ... END Regards,
                                  Message 16 of 19 , Jan 14, 2010
                                    John,

                                    It would be something like this: (verify with BOL)

                                    CREATE TRIGGER tr_TriggerChange
                                    ON DATABASE
                                    FOR DROP_TRIGGER, ALTER_TRIGGER
                                    AS
                                    BEGIN
                                    --- here you could log all actions,
                                    --- or check the EVENTDATA to verify the specific table involved,
                                    --- then log,
                                    --- or just ROLLBACK to prevent the change.
                                    --- If ROLLBACK, then this trigger would have to be disabled
                                    --- in order to made any other trigger changes.
                                    END


                                    Regards,

                                    Arnie Rowland, MVP (SQL Server)

                                    "You cannot do a kindness too soon because you never know how soon it
                                    will be too late."
                                    -Ralph Waldo Emerson




                                    -----Original Message-----
                                    From: SQLQueriesNoCode@yahoogroups.com
                                    [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of John Warner
                                    Sent: Thursday, January 14, 2010 10:51 AM
                                    To: Arnie
                                    Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                    triggers ??

                                    Arnie, how would an event/trigger to detect a trigger changing/being
                                    removed work? What I mean is, I really don't know how to begin coding
                                    something like this. Not asking you to do it as I learn nothing that way
                                    but what objects am I looking for, that sort of thing?

                                    Thanks to both you and Paul.

                                    John Warner


                                    > -----Original Message-----
                                    > From: SQLQueriesNoCode@yahoogroups.com
                                    > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Arnie Rowland
                                    > Sent: Thursday, January 14, 2010 1:43 PM
                                    > To: SQLQueriesNoCode@yahoogroups.com
                                    > Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                    > triggers ??
                                    >
                                    > John,
                                    >
                                    > Triggers don't 'just disappear'. As suggested, either a backup prior
                                    to
                                    > the trigger creation is being restored, or they are being removed.
                                    >
                                    > Removal would occur if the tables are dropped and recreated -which
                                    isn't
                                    > a far-fetched concept in some situations.
                                    >
                                    > Creating a DDL event to either rollback or just log table changes
                                    sould
                                    > give you useful information.
                                    >
                                    > Regards,
                                    >
                                    > Arnie Rowland, MVP (SQL Server)
                                    >
                                    > "You cannot do a kindness too soon because you never know how soon it
                                    > will be too late."
                                    > -Ralph Waldo Emerson
                                    >
                                    >
                                    >
                                    >
                                    > -----Original Message-----
                                    > From: SQLQueriesNoCode@yahoogroups.com
                                    > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of John Warner
                                    > Sent: Thursday, January 14, 2010 10:28 AM
                                    > To: Arnie
                                    > Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                    > triggers ??
                                    >
                                    > Good thought, might not tell me everything but could sure alert me to
                                    > something happening. Thanks Paul.
                                    >
                                    > (have you changed your email?)
                                    >
                                    > John Warner
                                    >
                                    >
                                    > > -----Original Message-----
                                    > > From: SQLQueriesNoCode@yahoogroups.com
                                    > > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of p_livengood
                                    > > Sent: Thursday, January 14, 2010 1:00 PM
                                    > > To: SQLQueriesNoCode@yahoogroups.com
                                    > > Subject: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                    > > triggers ??
                                    > >
                                    > > I have never encountered this, but if you want to track it down (or
                                    > prevent it)
                                    > > you could create a DDL Trigger that would fire if the triggers were
                                    > altered (or
                                    > > deleted) and either send an email, or stop the alteration.
                                    > >
                                    > > HTH
                                    > > Paul
                                    > >
                                    > > --- In SQLQueriesNoCode@yahoogroups.com, Damhuis Anton
                                    > > <DamhuisA@...> wrote:
                                    > > >
                                    > > > Hi John
                                    > > >
                                    > > > I have had a few situations like this before, and all but one time
                                    > (as
                                    > far as I
                                    > > can remember) was down to some *ghost* doing it.
                                    > > > In the one situation it was a DB restore of a previous version
                                    which
                                    > caused
                                    > > the triggers or stored procs to go missing.
                                    > > >
                                    > > > Hope you find the solution / cause
                                    > > >
                                    > > > Regards
                                    > > > Anton Damhuis
                                    > > >
                                    > > > ________________________________
                                    > > > Please note: This email and its contents are subject to the
                                    > disclaimer
                                    > as
                                    > > displayed at the following link:
                                    > > http://www.investmentsolutions.co.za/EmailLegalNotice.htm. Should
                                    you
                                    > not
                                    > > have web access, send an email to legalnotice@... and a copy of this
                                    > > disclaimer will be sent to you.
                                    > > >
                                    > > >
                                    > > > [Non-text portions of this message have been removed]
                                    > > >
                                    > >
                                    > >
                                    > >
                                    > >
                                    > > ------------------------------------
                                    > >
                                    > > Yahoo! Groups Links
                                    > >
                                    > >
                                    > >
                                    >
                                    >
                                    >
                                    > ------------------------------------
                                    >
                                    > Yahoo! Groups Links
                                    >
                                    >
                                    >
                                    >
                                    >
                                    >
                                    >
                                    > __________ Information from ESET Smart Security, version of virus
                                    > signature database 4772 (20100114) __________
                                    >
                                    > The message was checked by ESET Smart Security.
                                    >
                                    > http://www.eset.com
                                    >
                                    >
                                    >
                                    > __________ Information from ESET Smart Security, version of virus
                                    > signature database 4772 (20100114) __________
                                    >
                                    > The message was checked by ESET Smart Security.
                                    >
                                    > http://www.eset.com
                                    >
                                    >
                                    >
                                    > Disclaimer - January 14, 2010
                                    > This email and any files transmitted with it are confidential and
                                    intended solely
                                    > for SQLQueriesNoCode@yahoogroups.com. If you are not the named
                                    > addressee you should not disseminate, distribute, copy or alter this
                                    email. Any
                                    > views or opinions presented in this email are solely those of the
                                    author
                                    and
                                    > might not represent those of Westwood Consulting, Inc. Warning:
                                    Although
                                    > Westwood Consulting, Inc has taken reasonable precautions to ensure no
                                    > viruses are present in this email, the company cannot accept
                                    responsibility for
                                    > any loss or damage arising from the use of this email or attachments.
                                    > This disclaimer was added by Policy Patrol:
                                    http://www.policypatrol.com/
                                    >
                                    >
                                    > ------------------------------------
                                    >
                                    > Yahoo! Groups Links
                                    >
                                    >
                                    >



                                    ------------------------------------

                                    Yahoo! Groups Links







                                    __________ Information from ESET Smart Security, version of virus
                                    signature database 4772 (20100114) __________

                                    The message was checked by ESET Smart Security.

                                    http://www.eset.com



                                    __________ Information from ESET Smart Security, version of virus
                                    signature database 4772 (20100114) __________

                                    The message was checked by ESET Smart Security.

                                    http://www.eset.com
                                  • John Warner
                                    Thanks Arnie! John Warner
                                    Message 17 of 19 , Jan 15, 2010
                                      Thanks Arnie!

                                      John Warner


                                      > -----Original Message-----
                                      > From: SQLQueriesNoCode@yahoogroups.com
                                      > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Arnie Rowland
                                      > Sent: Thursday, January 14, 2010 2:43 PM
                                      > To: SQLQueriesNoCode@yahoogroups.com
                                      > Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                      > triggers ??
                                      >
                                      > John,
                                      >
                                      > It would be something like this: (verify with BOL)
                                      >
                                      > CREATE TRIGGER tr_TriggerChange
                                      > ON DATABASE
                                      > FOR DROP_TRIGGER, ALTER_TRIGGER
                                      > AS
                                      > BEGIN
                                      > --- here you could log all actions,
                                      > --- or check the EVENTDATA to verify the specific table involved,
                                      > --- then log,
                                      > --- or just ROLLBACK to prevent the change.
                                      > --- If ROLLBACK, then this trigger would have to be disabled
                                      > --- in order to made any other trigger changes.
                                      > END
                                      >
                                      >
                                      > Regards,
                                      >
                                      > Arnie Rowland, MVP (SQL Server)
                                      >
                                      > "You cannot do a kindness too soon because you never know how soon it
                                      > will be too late."
                                      > -Ralph Waldo Emerson
                                      >
                                      >
                                      >
                                      >
                                      > -----Original Message-----
                                      > From: SQLQueriesNoCode@yahoogroups.com
                                      > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of John Warner
                                      > Sent: Thursday, January 14, 2010 10:51 AM
                                      > To: Arnie
                                      > Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                      > triggers ??
                                      >
                                      > Arnie, how would an event/trigger to detect a trigger changing/being
                                      > removed work? What I mean is, I really don't know how to begin coding
                                      > something like this. Not asking you to do it as I learn nothing that way
                                      > but what objects am I looking for, that sort of thing?
                                      >
                                      > Thanks to both you and Paul.
                                      >
                                      > John Warner
                                      >
                                      >
                                      > > -----Original Message-----
                                      > > From: SQLQueriesNoCode@yahoogroups.com
                                      > > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Arnie
                                      > Rowland
                                      > > Sent: Thursday, January 14, 2010 1:43 PM
                                      > > To: SQLQueriesNoCode@yahoogroups.com
                                      > > Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                      > > triggers ??
                                      > >
                                      > > John,
                                      > >
                                      > > Triggers don't 'just disappear'. As suggested, either a backup prior
                                      > to
                                      > > the trigger creation is being restored, or they are being removed.
                                      > >
                                      > > Removal would occur if the tables are dropped and recreated -which
                                      > isn't
                                      > > a far-fetched concept in some situations.
                                      > >
                                      > > Creating a DDL event to either rollback or just log table changes
                                      > sould
                                      > > give you useful information.
                                      > >
                                      > > Regards,
                                      > >
                                      > > Arnie Rowland, MVP (SQL Server)
                                      > >
                                      > > "You cannot do a kindness too soon because you never know how soon it
                                      > > will be too late."
                                      > > -Ralph Waldo Emerson
                                      > >
                                      > >
                                      > >
                                      > >
                                      > > -----Original Message-----
                                      > > From: SQLQueriesNoCode@yahoogroups.com
                                      > > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of John Warner
                                      > > Sent: Thursday, January 14, 2010 10:28 AM
                                      > > To: Arnie
                                      > > Subject: RE: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                      > > triggers ??
                                      > >
                                      > > Good thought, might not tell me everything but could sure alert me to
                                      > > something happening. Thanks Paul.
                                      > >
                                      > > (have you changed your email?)
                                      > >
                                      > > John Warner
                                      > >
                                      > >
                                      > > > -----Original Message-----
                                      > > > From: SQLQueriesNoCode@yahoogroups.com
                                      > > > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of
                                      > p_livengood
                                      > > > Sent: Thursday, January 14, 2010 1:00 PM
                                      > > > To: SQLQueriesNoCode@yahoogroups.com
                                      > > > Subject: [SQLQueriesNoCode] Re:SQL Server Express 2005 disappear
                                      > > > triggers ??
                                      > > >
                                      > > > I have never encountered this, but if you want to track it down (or
                                      > > prevent it)
                                      > > > you could create a DDL Trigger that would fire if the triggers were
                                      > > altered (or
                                      > > > deleted) and either send an email, or stop the alteration.
                                      > > >
                                      > > > HTH
                                      > > > Paul
                                      > > >
                                      > > > --- In SQLQueriesNoCode@yahoogroups.com, Damhuis Anton
                                      > > > <DamhuisA@...> wrote:
                                      > > > >
                                      > > > > Hi John
                                      > > > >
                                      > > > > I have had a few situations like this before, and all but one time
                                      > > (as
                                      > > far as I
                                      > > > can remember) was down to some *ghost* doing it.
                                      > > > > In the one situation it was a DB restore of a previous version
                                      > which
                                      > > caused
                                      > > > the triggers or stored procs to go missing.
                                      > > > >
                                      > > > > Hope you find the solution / cause
                                      > > > >
                                      > > > > Regards
                                      > > > > Anton Damhuis
                                      > > > >
                                      > > > > ________________________________
                                      > > > > Please note: This email and its contents are subject to the
                                      > > disclaimer
                                      > > as
                                      > > > displayed at the following link:
                                      > > > http://www.investmentsolutions.co.za/EmailLegalNotice.htm. Should
                                      > you
                                      > > not
                                      > > > have web access, send an email to legalnotice@... and a copy of this
                                      > > > disclaimer will be sent to you.
                                      > > > >
                                      > > > >
                                      > > > > [Non-text portions of this message have been removed]
                                      > > > >
                                      > > >
                                      > > >
                                      > > >
                                      > > >
                                      > > > ------------------------------------
                                      > > >
                                      > > > Yahoo! Groups Links
                                      > > >
                                      > > >
                                      > > >
                                      > >
                                      > >
                                      > >
                                      > > ------------------------------------
                                      > >
                                      > > Yahoo! Groups Links
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > > __________ Information from ESET Smart Security, version of virus
                                      > > signature database 4772 (20100114) __________
                                      > >
                                      > > The message was checked by ESET Smart Security.
                                      > >
                                      > > http://www.eset.com
                                      > >
                                      > >
                                      > >
                                      > > __________ Information from ESET Smart Security, version of virus
                                      > > signature database 4772 (20100114) __________
                                      > >
                                      > > The message was checked by ESET Smart Security.
                                      > >
                                      > > http://www.eset.com
                                      > >
                                      > >
                                      > >
                                      > > Disclaimer - January 14, 2010
                                      > > This email and any files transmitted with it are confidential and
                                      > intended solely
                                      > > for SQLQueriesNoCode@yahoogroups.com. If you are not the named
                                      > > addressee you should not disseminate, distribute, copy or alter this
                                      > email. Any
                                      > > views or opinions presented in this email are solely those of the
                                      > author
                                      > and
                                      > > might not represent those of Westwood Consulting, Inc. Warning:
                                      > Although
                                      > > Westwood Consulting, Inc has taken reasonable precautions to ensure no
                                      > > viruses are present in this email, the company cannot accept
                                      > responsibility for
                                      > > any loss or damage arising from the use of this email or attachments.
                                      > > This disclaimer was added by Policy Patrol:
                                      > http://www.policypatrol.com/
                                      > >
                                      > >
                                      > > ------------------------------------
                                      > >
                                      > > Yahoo! Groups Links
                                      > >
                                      > >
                                      > >
                                      >
                                      >
                                      >
                                      > ------------------------------------
                                      >
                                      > Yahoo! Groups Links
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      > __________ Information from ESET Smart Security, version of virus
                                      > signature database 4772 (20100114) __________
                                      >
                                      > The message was checked by ESET Smart Security.
                                      >
                                      > http://www.eset.com
                                      >
                                      >
                                      >
                                      > __________ Information from ESET Smart Security, version of virus
                                      > signature database 4772 (20100114) __________
                                      >
                                      > The message was checked by ESET Smart Security.
                                      >
                                      > http://www.eset.com
                                      >
                                      >
                                      >
                                      > ------------------------------------
                                      >
                                      > Yahoo! Groups Links
                                      >
                                      >
                                      >
                                    • Prasanna Dhakephalkar
                                      Hi,   we use varible query inside with clause ? Like   WITH tim AS ( select abc from || Input_table_name || a where num 5 ) select abc from tim;  
                                      Message 18 of 19 , Jan 22, 2010
                                        Hi,
                                         
                                        we use varible query inside with clause ?
                                        Like
                                         
                                        WITH tim AS
                                        ( ' select abc from ' || Input_table_name || ' a where num > 5')
                                        select abc from tim;
                                         
                                        This is part of a strored procedure input_table_name is a varchar2 input value to the procedure.
                                         
                                         
                                        I have variable query that gets used 3 times as a sub query,
                                        I thought with clause can help me.
                                         
                                        As such it is not allowing me.
                                         
                                        Any help is welcome.
                                         
                                        Thanks and Regards,
                                         
                                        Prasanna.




                                        [Non-text portions of this message have been removed]
                                      • Arnie Rowland
                                        You cannot use dynamic SQL inside a common table expression (cte) as you are attempting. You might be able to make the entire CTE dynamic SQL -but I think
                                        Message 19 of 19 , Jan 22, 2010
                                          You cannot use dynamic SQL inside a common table expression (cte) as you are attempting.

                                          You 'might' be able to make the entire CTE dynamic SQL -but I think you would find that to be very cumbersome and perhaps ineffective for the task.


                                          Regards,

                                          Arnie Rowland, MVP (SQL Server)

                                          "You cannot do a kindness too soon because you never know how soon it will be too late."
                                          -Ralph Waldo Emerson



                                          -----Original Message-----
                                          From: SQLQueriesNoCode@yahoogroups.com [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Prasanna Dhakephalkar
                                          Sent: Friday, January 22, 2010 6:25 AM
                                          To: Arnie
                                          Subject: [SQLQueriesNoCode] With Clause

                                          Hi,

                                          we use varible query inside with clause ?
                                          Like

                                          WITH tim AS
                                          ( ' select abc from ' || Input_table_name || ' a where num > 5')
                                          select abc from tim;

                                          This is part of a strored procedure input_table_name is a varchar2 input value to the procedure.


                                          I have variable query that gets used 3 times as a sub query,
                                          I thought with clause can help me.

                                          As such it is not allowing me.

                                          Any help is welcome.

                                          Thanks and Regards,

                                          Prasanna.




                                          [Non-text portions of this message have been removed]



                                          ------------------------------------

                                          Yahoo! Groups Links







                                          __________ Information from ESET Smart Security, version of virus signature database 4797 (20100122) __________

                                          The message was checked by ESET Smart Security.

                                          http://www.eset.com



                                          __________ Information from ESET Smart Security, version of virus signature database 4797 (20100122) __________

                                          The message was checked by ESET Smart Security.

                                          http://www.eset.com



                                          Disclaimer - January 22, 2010
                                          This email and any files transmitted with it are confidential and intended solely for SQLQueriesNoCode@yahoogroups.com. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of Westwood Consulting, Inc. Warning: Although Westwood Consulting, Inc has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.
                                          This disclaimer was added by Policy Patrol: http://www.policypatrol.com/
                                        Your message has been successfully submitted and would be delivered to recipients shortly.