how can i combine the tables with the structure,data into another table?

Posted by Sudheep.grandhe under Sql Server on 12/1/2011 | Points: 10 | Views : 1033 | Status : [Member] | Replies : 7
Hi,

I am having three tables named like tbl_report1,tbl_report2,tbl_customer .my issue is i want to combine these tables data and structure into one table like tbl_company.is it possible?.if possible in the sense can you please give me the suggesstion.please do the needful.
tbl_report1 columns:
invoiceno,particulars,quantity,perprice,amount,orderno,compname,invoicedate,ondate,invoiceid.

tbl_report2 columns:
compname,compaddress,invoiceno(primarykey),orderno,invoicedate,ondate,amountstatus,netvat,netamount,tamount

tbl_customer columns:
custid(primarykey),custname,custaddress,custcity,custstate,custstdcode,custphoneno,custmobileno


from the above three tables i want to copy their data and structure into tbl_company.how can i proced.

Best,
Sudheep.



Responses

Posted by: Blessyjees on: 12/1/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

What is the purpose of this?

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 12/1/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Chechi,

i am not able to retrieve the data from particulary one table.some columns are in another table.that's why i want to combine the data and structure into one table with the help of this table i can retrieve the information.no need to go for other tables.

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Blessyjees on: 12/1/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

This is a good practice.

First you set relation between these tables using primary key and tried to retrieve data.

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 12/1/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

please help me for creating the realotionship b/w the tables.i am trying to create a fk in tbl_report1 it wont allow me to create realtionship b/w tbl_report1 and tbl_report2.in tbl_report2 -invoiceno(primary key).in tbl_report1 matched column is invoiceno only .But,it wont allow to create the realtionship.how can i proced further.please do the needful.

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 12/1/2011 [Member] Starter | Points: 25

Up
0
Down
You need to study normal form for creating relation ,try your best to go thouroly so that it will helpp u in fututre

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 12/2/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

I am creating the relationship between the tables as tbl_report1,tbl_report2.how can i copy the data and structure from tbl_report1,tbl_report2 into tbl_company.can you please provide the steps are sample coding.

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ravindra.patil on: 12/3/2011 [Member] Starter | Points: 25

Up
0
Down

Hi sudheep,

Check below link it may help you.

http://stackoverflow.com/questions/57168/how-to-copy-a-row-from-one-sql-server-table-to-another

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response