Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2012
    Posts
    3

    Red face Unanswered: merging two databases,

    hello friends,
    Please help me to sort out this pbm as I am new to job and struggling to continue, I am usin sql 2012

    i have two tables named sales and purchase and both have same fieldname called tr_item and tr_quantity. in a database called X

    what I have to do now is , I have another database named Y and der I have to create a table named TAB which contains same tr_item,ptotal,stotal
    tr_item= same tr_item from sales and purchase of database 'X', and also total of tr quantiy sales
    ptotal = total quantity of purchase ,
    stotal = total; quantity of sales.

    please help me to sort out , my TL said to use while and use append to do it. please help me.

  2. #2
    Join Date
    Dec 2008
    Location
    At work...
    Posts
    92
    This isn't really an ANSI SQL related issue.

    I suggest you ask your question in the MS SQL Server forum instead, the people over there can probably help you!

  3. #3
    Join Date
    Dec 2012
    Posts
    3

    how to use two databases

    --------------------------------------------------------------------------------
    hello friends,
    Please help me to sort out this pbm as I am new to job and struggling to continue, I am usin sql 2012

    i have two tables named sales and purchase and both have same fieldname called tr_item and tr_quantity. in a database called X

    what I have to do now is , I have another database named Y and der I have to create a table named TAB which contains same tr_item,ptotal,stotal
    tr_item= same tr_item from sales and purchase of database 'X', and also total of tr quantiy sales
    ptotal = total quantity of purchase ,
    stotal = total; quantity of sales.

    please help me to sort out , my TL said to use while and use append to do it. please help me

  4. #4
    Join Date
    Dec 2012
    Posts
    3

    how to use two databases

    --------------------------------------------------------------------------------
    hello friends,
    Please help me to sort out this pbm as I am new to job and struggling to continue, I am usin sql 2012

    i have two tables named sales and purchase and both have same fieldname called tr_item and tr_quantity. in a database called X

    what I have to do now is , I have another database named Y and der I have to create a table named TAB which contains same tr_item,ptotal,stotal
    tr_item= same tr_item from sales and purchase of database 'X', and also total of tr quantiy sales
    ptotal = total quantity of purchase ,
    stotal = total; quantity of sales.

    please help me to sort out , my TL said to use while and use append to do it. please help me

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    two comments

    first, if you are using sql server 2012, you are in the wrong forum

    second, your TL is wrong -- WHILE is not required, and "append" is valid only in the sense that you need an INSERT statement
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    your TL is wrong -- WHILE is not required, and "append" is valid only in the sense that you need an INSERT statement
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    threads mergered and moved to the SQL server forum
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •