If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > how to use two databases

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-18-12, 07:48
maxresh maxresh is offline
Registered User
 
Join Date: Dec 2012
Posts: 3
Red face 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.
Reply With Quote
  #2 (permalink)  
Old 12-18-12, 09:49
JarlH JarlH is offline
Registered User
 
Join Date: Dec 2008
Location: At work...
Posts: 79
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!
Reply With Quote
  #3 (permalink)  
Old 12-19-12, 00:26
maxresh maxresh is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 12-19-12, 00:29
maxresh maxresh is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 12-19-12, 02:49
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 20,000
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 12-19-12, 02:50
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 20,000
your TL is wrong -- WHILE is not required, and "append" is valid only in the sense that you need an INSERT statement
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 12-19-12, 03:41
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 10,508
threads mergered and moved to the SQL server forum
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On