不同数据库中的两个表 结构不同 如何合并成一个新表?谢谢

解决方案 »

  1.   

    select * from  dbname.dbo.tablename
      

  2.   


    select * from 数据库1.dbo.表1
    union all
    select * from 数据库2.dbo.表2
      

  3.   

    select COL1,COL2.... from 数据库1.dbo.表1 
    union all 
    select COL1,COL2.... from 数据库2.dbo.表2
      

  4.   

    select * from 数据库1.dbo.表1 
    union all 
    select * from 数据库2.dbo.表2
      

  5.   


    DataTable a = new DataTable();
    string sql = "select ...";
    NewStuConn = new SqlConnection(sel);
    NewStusqlda = new SqlDataAdapter(sql, NewStuConn);
    NewSqlCommand = new SqlCommand(sql);
    NewStusqlda.Fill(a);这点应该怎么写??