Hi guys i need help i want to move the existing data from table 1 into table 2 how i need to write the query. I tried the select into statement but it did not work at all. So how to do it . Please help i doing this on the vb6 programming

SELECT INTO Table2 (Field1, Field2, Field3) SELECT Table1.Field1, Table1.Field2, Table1.Field3 FROM Table1

As table2 already exists.


Good Luck

SELECT INTO Table2 (Field1, Field2, Field3) SELECT Table1.Field1, Table1.Field2, Table1.Field3 FROM Table1

As table2 already exists.


Good Luck

Why cant move into table1 to table 2 got error in query analyzer
said syntax near error INTO. Here the code:

SELECT INTO staff_badgeTracking (400001, '12345', 'nana') 
SELECT staff_badgeTrackingNew.400001, staff_badgeTrackingNew.12345, staff_badgeTrackingNew.nana FROM staff_badgeTrackingNew

SELECT INTO staff_badgeTracking (Field1Name) SELECT ...

You need to use the name of the field in between those parens without any single ticks ', then it should work for you.


Good Luck

SELECT INTO staff_badgeTracking (Field1Name) SELECT ...

You need to use the name of the field in between those parens without any single ticks ', then it should work for you.


Good Luck

still can not work can you write a full example and dun use the fieldname use something real like fieldname1= name or something like that?

SELECT INTO staff_badgeTracking (400001, 12345, nana)
SELECT staff_badgeTrackingNew.400001, staff_badgeTrackingNew.12345, staff_badgeTrackingNew.nana FROM staff_badgeTrackingNew


Good Luck

To move data use update statement. SET the field values of the data u want to move data from to the field value where u want to move the data to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.