title: Insert multiple table data into temp table as a time
body: <p>I am having 3 tables like below.</p>
  
  <p><strong>Table A:</strong>(Having one column Employee id)</p>
  
  <pre><code>Employee Id
     101
     102
     103
  </code></pre>
  
  <p><strong>Table B:</strong>(Having One column EmployeeName)</p>
  
  <pre><code>EmpName
  Sai
  sarath
  vijay
  </code></pre>
  
  <p><strong>Table C</strong>:(Having One column DeptName)</p>
  
  <pre><code>DeptName**.
  IT
  ACCOUNTS
  MANAGEMENT
  </code></pre>
  
  <p>Here i want to insert all three table columns values into one temp table.
  Like</p>
  
  <pre><code>Create table #mytable (employeeid nvarchar(255),empname nvarchar(255),deptname nvarchar(255))
  
  insert into #mytable (employeeid)
  
  select employeeid from tableA
  insert into #mytable (empname)
  
  select empname from tableB
  insert into #mytable (deptname)
  
  select deptname from tableC
  </code></pre>
  
  <p>But here my temp table (i.e.) #mytable gives me result like  below table.</p>
  
  <pre><code>**Employeeid                Empname              DeptName**
      101                          null                  null
      102                          null                  null
      103                          null                  null
      null                        sai                    null
      null                       Sarath                  null
      null                        vijay                  null
      null                        null                   IT
      null                        null                    ACCOUNTS
      null                        null                    MANAGEMENT
  </code></pre>
  
  <p>But i wants to display only data rows not null values.Please give me any suggestions for insert all three table i.e A,B,C at a time into temp table i.e #mytable.And display only data containing rows. </p>
  
  <p>And i have tried query like below</p>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <pre><code> insert into tb_MBUPSheetData123 ([BusinessStrategyMessaging],Capability,[DealSource],Language,LicenseType,[Proactive activity],[Proposal Type],RFXSolution,
     SLBusinessSolutionArea,SolutionForProposal,SupportingSolution,Conversations,TopicForProposal,SalesDeskAgentAlias)
  
  values ((select [BusinessStrategyMessaging] from tb_MBUPSheetData where BusinessStrategyMessaging is not null),
  (select [DealSource]  FROM tb_MBUPSheetData where DealSource is not null),
  (select [Capability] FROM tb_MBUPSheetData where Capability is not null),
   (select [Language] FROM tb_MBUPSheetData where Language is not null)
   ,(select [LicenseType] FROM tb_MBUPSheetData where LicenseType is not null),
  
  (select [Proactive activity]  FROM tb_MBUPSheetData where [Proactive activity] is not null),
  (select [ProposalType] FROM tb_MBUPSheetData where [Proposal Type] is not null),
  (select[RFXSolution] FROM tb_MBUPSheetData where RFXSolution is not null),
  (select [SLBusinessSolutionArea] FROM tb_MBUPSheetData where SLBusinessSolutionArea is not null),
  (select [SolutionForProposal]FROM tb_MBUPSheetData where SolutionForProposal is not null),
  (select [SupportingSolution] FROM tb_MBUPSheetData  where SupportingSolution is not null),
   (select Conversations FROM tb_MBUPSheetData where Conversations is not null),
   (select [TopicForProposal] FROM tb_MBUPSheetData where TopicForProposal is not null),
   (select [SalesDeskAgentAlias]  FROM tb_MBUPSheetData where SalesDeskAgentAlias is not null))
  </code></pre>
  
  <p>But i am getting below error</p>
  
  <p>Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , >, >= or when the subquery is used as an expression.
  The statement has been terminated.</p>
  
  <p>Any suggestions... </p>