Joining two tables into one table
Posted on 2013-05-28
Hi, I have two tables tableA and tableB and below are the schemas. Now, I want to get rid of the one
of these tables as I have to combine them into one table to improve the performance in my
stored procedure's and udf's where these both tables are joined... The joining key for relating these 2 tables is the questiondependencyid.... some questiondependencyid’s can have more than one row in the table B....
Can anyone please give me that tsql script to do this ? what is the best method to do this ?
TableA Schema with sample data
QuestionDependencyID questionid createdby createddate
32 97 1 2007-12-06 16:24:00
33 98 1 2007-12-08 16:24:00
TableB Schema with sample data
Dependentruleid QuestionDependencyID Value
10 32 1
11 32 2
12 32 4
13 33 9