Hey guys please guide me on this:
i have an SQLProcedure defined for my project, which will lookup in three tables for the presence of the name entered in text box but i don't know how to perform this query on button press which will display result automatically below the search panel as shown in screen.
have a look here:
Sample Table code:
CREATE TABLE Table1 (Name Nvarchar(10));
CREATE TABLE Table2 (Name Nvarchar(10));
CREATE TABLE Table3 (Name Nvarchar(10));
INSERT INTO Table1 VALUES ('Joe');
INSERT INTO Table3 VALUES ('Joe');
My SQL StoredProcedure:
SELECT
CASE WHEN t1.Name IS NULL THEN 'No' ELSE 'Yes' END as Table1
,CASE WHEN t2.Name IS NULL THEN 'No' ELSE 'Yes' END as Table2
,CASE WHEN t3.Name IS NULL THEN 'No' ELSE 'Yes' END as Table3
FROM Table1 t1
FULL JOIN Table2 t2 ON t1.Name = t2.Name
FULL JOIN Table3 t3 ON t1.Name = t3.Name OR t3.Name = t2.Name
AND t1.Name = 'Joe' AND t2.Name = 'Joe' AND t3.Name = 'Joe'
My Aim is : user enter a name that is lookup based on my sql stored procedure in 3 different table and depending on it the Result is displayed as you can see in image.
http://sqlfiddle.com/#!6/6f3ad/7
E.g:
Joe will be replaced by Name.Text
I have created stored procedure, frontend.
I want to know how to display result based on my sql procedure. Please help me.