Professional Web Applications Themes

Council to make an sp. - Microsoft SQL / MS SQL Server

I must to implent a sp that checks data into a one to one relationed table and let me know if all data is available or not. To better understand (sorry for my poor english) imagine this. TABLE 1 ID DESCR QTA 1 aaa 1 2 bbb 1 TABLE 2 ID DESCR REALQTA 1 aaaa 4 2 bbbb 1 Because data in table 2 is added only in a certain moment of app live, may be that table 2 doesn't contain any row related to table 1 or just an half or something like it. I want to do an ...

  1. #1

    Default Council to make an sp.

    I must to implent a sp that checks data into a one to one relationed
    table and let me know if all data is available or not.

    To better understand (sorry for my poor english) imagine this.

    TABLE 1

    ID DESCR QTA
    1 aaa 1
    2 bbb 1

    TABLE 2

    ID DESCR REALQTA
    1 aaaa 4
    2 bbbb 1

    Because data in table 2 is added only in a certain moment of
    app live, may be that table 2 doesn't contain any row related
    to table 1 or just an half or something like it.

    I want to do an sp that say me if row into table1 and table 2
    match per number, and that realqta is filled and not an empty
    or a negative number (I must to decide in which way recognize
    when data is present).

    I hope that someone can help me.

    Sincerely
    Andrea Moro


    Andrea Moro Guest

  2. #2

    Default Council to make an sp.

    I think that the sentence "NOT EXISTS" can help you. Here
    is an example:

    SELECT ID FROM Table1 T1 WHERE T1.Id = T2.Id AND NOT
    EXISTS (SELECT ID FROM Table2 T2)
    >-----Original Message-----
    >I must to implent a sp that checks data into a one to
    one relationed
    >table and let me know if all data is available or not.
    >
    >To better understand (sorry for my poor english) imagine
    this.
    >
    >TABLE 1
    >
    >ID DESCR QTA
    >1 aaa 1
    >2 bbb 1
    >
    >TABLE 2
    >
    >ID DESCR REALQTA
    >1 aaaa 4
    >2 bbbb 1
    >
    >Because data in table 2 is added only in a certain
    moment of
    >app live, may be that table 2 doesn't contain any row
    related
    >to table 1 or just an half or something like it.
    >
    >I want to do an sp that say me if row into table1 and
    table 2
    >match per number, and that realqta is filled and not an
    empty
    >or a negative number (I must to decide in which way
    recognize
    >when data is present).
    >
    >I hope that someone can help me.
    >
    >Sincerely
    >Andrea Moro
    >
    >
    >.
    >
    Ton Guest

Similar Threads

  1. i really wana make flash which prog do i download? andhow do i make it?
    By bob dole rules!!!!! in forum Macromedia Flash Flashcom
    Replies: 2
    Last Post: January 14th, 07:26 PM
  2. Am I wasting my time? I seek council.
    By Captain Ru in forum Coldfusion - Advanced Techniques
    Replies: 8
    Last Post: July 29th, 10:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139