Question: I have created an access query with a 3 field output of approx 700 records that I would like to use as an input to a passthru query to SQL server.

I have tested the process entirely in SQL server, and it works fine, but when I try to run the same code in a passtrhu, I get an error 

> 
> Pass-through query with returnrecords property set to yes did not
>  return any records.
> 
> 
> 

Here is the first few lines of the query:

```
if object_id('tempdb..#marktmp1') is not null drop table #marktmp1
create table #marktmp1
(Cid bigint,
Ccd varchar(6),
Ciss int);
/*
Insert into #marktmp1
values
(5110029175,    'SPO',  17),
(5110029722,    'SPO',  17),
(5110035139,    'SPO',  17);

```

I just copy/past the output of the first query into the list above

At the end of the list of records, I try to join the `#marktmp1` table to existing tables.

We are on Sql Server 2012.

Answer: 
Without seeing the rest of your code, I'm guessing you never do a select or return a result set in any other way (like calling a stored procedure). If that's the case, check the **IMPORTANT** note in this answer:

[how-to-create-temp-tables-in-sql-server-via-ms-access](https://stackoverflow.com/questions/16841173/how-to-create-temp-tables-in-sql-server-via-ms-access/16844765#16844765)

Note, also check Gord Thompson's answer right after mine and make sure you won't have trouble with that.
Easy solution: add `SET NOCOUNT ON` as the first command in the pass thru.

What is happening is when you insert records to the `#temp` table, SQL server responds with `### Record(s) affected.` Access sees this message and interprets it as completion of the query, yet finds no rows returned. This is why you get 

> 
> Pass-through query with returnrecords property set to yes did not
>  return any records
> 
> 
> 

`SET NOCOUNT ON` turns off those information messages, and access will then wait for the final `SELECT` to occur.