Search code examples
sql-serveralwayson

Using ApplicationIntent=ReadOnly with stored procedures which insert data to temp tables


I'm using SQL Server 2012 AlwaysOn listener and I want to use a connection with ApplicationIntent=ReadOnly parameter for calling some stored procedures, and this is my question: stored procedures which insert data into temp table can use connection with ApplicationIntent=ReadOnly ?


Solution

  • According to Readable Secondary Replicas

    Note

    Though you cannot write data to secondary databases, you can write to read-write databases on the server instance that hosts the secondary replica, including user databases and system databases such as tempdb.

    So the answer is your stored procedures will work.