| Author |
Topic |
|
ontljoshi
Starting Member
13 Posts |
Posted - 2007-04-03 : 08:50:20
|
| hi,i have 2 tables and scnario is like this...sheet1 field1 field2l1_cust_ref abc l1_title mr sifa_datal1_cust_ref l1_titleabc mri want to transfer all the records from sheet1 to sifa_data but in here thig is like ...what values field1 is haveing are field for sifa_data table and what fields2 having are values for sifadata field's values.so kindly help me..in that.thanksom joshi |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
ontljoshi
Starting Member
13 Posts |
Posted - 2007-04-03 : 09:57:10
|
| WHAT INFORMATION YOU WANT MORE LIKE....BECAUSE I AM BEGINEER IN SQL...JUST TRYING TO SORT THIS OUT...MY TABLE1: SHEET1 HAS 2 FIELDS1) FIELD1 AND FIELD22) FIELD1 HAS MANY VALUES LIKE L1_CUST_REF, L1_TITLE, AND SO ON3) FIELD2 HAS MANY VALUES LIKE ABC,TITLE,AND SO ONNOW I HAVE TABLE LIKE SIFA_DATA WHICH HAS SEVERAL FIELDS LIKE L1_CUST_REF, L1_TITLE, AND SO ON...ACTUALLY FIELD1'S VALUES ARE THE ACTUAL FIELDS FOR SIFA_DATA TABLE AND FIELD2 VALUES ARE ACTUAL VALUES FOR SIFA_DATA'S FIELDS.KINDLY DO NEEDFUL THANKS IN ADVANCE.REGARDSOMom joshi |
 |
|
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2007-04-03 : 10:10:36
|
| Not to sure what you are really trying to do, Can you post the table schema at all?However if you are trying to transfer certain columns data out of one table and insert just them into a second table something like the following will work Example :--create the two tablescreate table tblOne (OneID int identity(1,1),CustName varchar(30),CustCity varchar(20),CustTelephone Varchar(12))Create Table tblSecond(SecondID int Identity(1,1),CustName varchar(30),CustTelphone varchar(30))--The to just move one to the other you can use a select statement with an insert statementInsert into tblSecond (CustName,CustTelephone)Select CustName,CustTelephone From tblOneThis will work for a quick transfer!!!If that is what you are after I hope |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-04-03 : 10:32:52
|
Something along these lines?Insert into Sifa_Data(L1_CUST_REF, L1_TITLE, ...)Select Case when Field1 = 'L1_CUST_REF' then Field2 else NULL end as L1_CUST_REF, Case when Field1 = 'L1_TITLE' then Field2 else NULL end as L1_TITLE ...From SHEET1 Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
ontljoshi
Starting Member
13 Posts |
Posted - 2007-04-03 : 10:57:42
|
| sorry to being a very nasty...harshbut would you like to tell me what would be the end point if i you that i was trying Select Case when Field1 = 'L1_CUSTOMER_REFERENCE' then Field2 else NULL end as L1_CUSTOMER_REFERENCE, Case when Field1 = 'L1_TITLE' then Field2 else NULL end as L1_TITLEend;but it gives me an error as its not proper sorry once again.regards,omom joshi |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
ontljoshi
Starting Member
13 Posts |
Posted - 2007-04-03 : 11:58:15
|
quote: Originally posted by harsh_athalye Something along these lines?Insert into Sifa_Data(L1_CUST_REF, L1_TITLE, ...)Select Case when Field1 = 'L1_CUST_REF' then Field2 else NULL end as L1_CUST_REF, Case when Field1 = 'L1_TITLE' then Field2 else NULL end as L1_TITLE ...From SHEET1 Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
this gives me syatax error...i am trying this stuff in ms Access kindly help....because i have recovered the data from pascal based application and which total mess of files...and i dont have mastery as you guys have...kindly do needful.thanksomom joshi |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-04-03 : 12:00:43
|
| Aha!! Now I see why my suggestion didn't work!Why you are posting Access question in SQL 2005 forum? Post in appropriate forum to get correct answers.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
ontljoshi
Starting Member
13 Posts |
Posted - 2007-04-03 : 12:06:22
|
quote: Originally posted by harsh_athalye Aha!! Now I see why my suggestion didn't work!Why you are posting Access question in SQL 2005 forum? Post in appropriate forum to get correct answers.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
thanks but my logic was telling me that its related with quries thats why i have placed into this..part. please get me an solution...it would be great help to me..thanks.om joshi |
 |
|
|
|