I have a VB app hitting a MSAccess DB.
Currently, I run a series of SQL statements against the DB whenever there is an INSERT needed:
Is there a way to union these together so I only hit the DB once (instead of having a statement for every record)?
Something like :
Seems like it should work as the individual SELECTS work -- but Access keeps asking for a table.
Even if I forgo the INSERT and just run the union -- it still asks for a table:
Any ideas?
Currently, I run a series of SQL statements against the DB whenever there is an INSERT needed:
Code:
INSERT INTO tblRepData (fname,lname,unit,date,metric,value)
SELECT 'Julie' , 'Carroll' , 'Stop Payment' , '1/1/2001' , 'Accts Worked' , '3'
INSERT INTO tblRepData (fname,lname,unit,date,metric,value)
SELECT 'Bob','Smith','Stop Payment','1/1/2001','Accts Worked','7'
Is there a way to union these together so I only hit the DB once (instead of having a statement for every record)?
Something like :
Code:
INSERT INTO tblRepData (fname,lname,unit,date,metric,value)
SELECT 'Julie' , 'Carroll' , 'Stop Payment' , '1/1/2001' , 'Accts Worked' , '3'
union all
SELECT 'Bob','Smith','Stop Payment','1/1/2001','Accts Worked','7'
Even if I forgo the INSERT and just run the union -- it still asks for a table:
Code:
SELECT 'Julie' , 'Carroll' , 'Stop Payment' , '1/1/2001' , 'Accts Worked' , '3'
union all
SELECT 'Bob','Smith','Stop Payment','1/1/2001','Accts Worked','7'
Any ideas?