Query Help - Delete Then Insert (1 Viewer)

BlueIshDan

☠
Local time
Today, 18:55
Joined
May 15, 2014
Messages
1,122
Hello Friends! :)

I have a query that is quite onerous and have decided that it can be cached rather than running every time the interface changes filters.

My question is, why isn't it letting me have two queries separated by a semi colon. I've done it before, and can't figure out what's so different about this instance.

Code:
DELETE * FROM pds_models;

INSERT INTO pds_models ( model_no, discipline )

SELECT DISTINCT model_no, DISCIPLINE_INDX_NO AS discipline

FROM (
	SELECT model_no, DISCIPLINE_INDX_NO 
	FROM PD_2000_PDTABLE_113

     	UNION

     	SELECT model_no, DISCIPLINE_INDX_NO 
	FROM PD_2100_PDTABLE_113

)  AS ModelsUnion

WHERE 
	model_no NOT LIKE '*tmp*' AND
	model_no NOT LIKE '*temp*' AND
	model_no NOT LIKE '*stdy*' AND
	model_no NOT LIKE '*study*' AND
	model_no NOT LIKE '*test*' AND
	model_no NOT LIKE '*tst*' AND
	model_no NOT IN (SELECT model_no FROM SPRExcludes);

Any ideas? Thanks for reading! =]
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:55
Joined
Aug 30, 2003
Messages
36,125
Access doesn't support multiple statements like SQL Server does.
 

BlueIshDan

☠
Local time
Today, 18:55
Joined
May 15, 2014
Messages
1,122
The joys of remembering things from other environments >.<

Thank you pbaldy. =]
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:55
Joined
Aug 30, 2003
Messages
36,125
No problemo. I miss comments and formatting from SQL Server too.
 

Users who are viewing this thread

Top Bottom