Link to home
Start Free TrialLog in
Avatar of sandeep437
sandeep437

asked on

joning tables

Hi

I am writing a stored proc and it has two select statements.

wht i need is how to combine the two tables that are returned from the two select statements and display the combined table in the datagrid. Both the select statment tables have same data types. and the statements are parameterized statements. so i am not able to use the 'View' in this context.

is there any other possible solution for this.

Thanks
sandeep
Avatar of MogalManic
MogalManic
Flag of United States of America image

What web language are you using?
Avatar of sandeep437
sandeep437

ASKER

SQL server 2000
If the two tables are in the same database, you can just join the two tables with a select statement:

SELECT publishers.name, publishers.id, books.title
        FROM publishers INNER JOIN books ON publishers.id = books.publisher_id


The above SQL joins Publishers table with books table.
ASKER CERTIFIED SOLUTION
Avatar of variant7
variant7

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Variant7

       yeah. UNION is working good in this situation.

thanks

sandeep