How to use Append Operation in SqlServer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phanikumar32
    New Member
    • Apr 2014
    • 22

    How to use Append Operation in SqlServer

    Hi All,

    I am trying to append two tables,those present in my database.
    The theme i want to output as,display all the columns from both the tables in the result.

    Means that if the first table contains 3 columns and the second table contains 4 columns. so Total 7 columns i want to display in the result.(remembe r one thing that there is no common column for both the tables.)

    The following figures shows the input and output what i exactly asking.

    So could any one please provide me the result how should i get this.

    Thanks In Advance,
    Phani Kumar.
    Attached Files
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    This is not possible to do without either a common field to join on or a unique field to order the two tables in the order you need it.

    You already said the former doesn't exist so your only option is the latter. The first table already has a unique field that you can use to order it. You will have to create one for the second table. After you create that field, then you can join them by the ordering field.

    Comment

    Working...