Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 about stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-10 : 07:48:56
jjbala writes "My question is

here i am having 4 tables like a,b,c,d and now i want to search a particular no like part no and each of the 4 tables have that field part no. so now i want to search the no in all the 4 table and if the no is there then insert all the corresponding fields to the new table. table d having all the part no of another 3 tables. all the tables have a same field name like pcode.

so now i want a procedure to search the partno


regards
jjbala"

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-03-10 : 07:57:34
Declare @Partno int

Insert into table_d
(partno, , , )
Select partno, , ,
From table_a
where partno = @Partno

Insert into table_d
(partno, , , )
Select partno, , ,
From table_b
where partno = @Partno

Insert into table_d
(partno, , , )
Select partno, , ,
From table_c
where partno = @Partno



Jim
Users <> Logic
Go to Top of Page
   

- Advertisement -