I'm trying to build off of this answer How do I run a large script with many inserts without running out of memory?
and break up a query into smaller ones with BEGIN TRANSACTION and then GO's
BEGIN TRANSACTION;
MERGE ghcnd.dbo.us_APCP as target
using
(values
('US1CASN0123','2018-03-22','--N','251'),
('US1KSGO0013','2018-03-22','--N','41'),
('US1WYFM0039','2018-03-22','--N','0'),
('US1SCCF0008','2018-03-22','--N','10'))
as source(cell,[date],valueFlag,[value])
on target.cell = source.cell
AND target.date = source.date
when matched then
update
set valueFlag = source.valueFlag ,
value = source.value
when not matched then
insert (cell,[date],valueFlag,[value])
values (cell,[date],valueFlag,[value])
COMMIT TRANSACTION; GO
However I get this error
Msg 102, Level 15, State 1, Line 3 Incorrect syntax near ')'. Msg 102, Level 15, State 1, Line 3 Incorrect syntax near 'GO'.