(im not sure what does per number mean)>I want to do an sp that say me if row into table1 and table 2
>match per number,
declare x int
delcare y int
select x=count(*) from table1
select y=count(*) from table2
x and y variables will contain the total number of rows exists in
decide in which way recognize>and that realqta is filled and not an empty or a negative number (I must tofollowing query will return the rows which has either realqta null or has <>when data is present).
select * from table2
where (realqta is null or realqta < 0)
"Andrea Moro" <moroandreaETtiscalinet.it> wrote in message
news:e9x#FwkQDHA.3192TK2MSFTNGP10.phx.gbl...> 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.
> Andrea Moro