question

36939850 avatar image
0 Votes"
36939850 asked MaxwellMcGraw-6840 answered

Using ApplicationIntent=ReadOnly in C# with stored procedures which modfies data to temp/non temp tables

I'm using SSMS 18 and using a connection with ApplicationIntent=ReadOnly parameter in C# AppConfig for executing some stored procedures, these procs are inserted in local db and this is my question: stored procedures which insert data into temp or non temp table can still insert, update, delete records even though connection is with ApplicationIntent=ReadOnly ?

dotnet-csharpdotnet-aspnet-mvc
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SasukeUchiha-9016 avatar image
0 Votes"
SasukeUchiha-9016 answered

Hi, I'm assuming that you're trying to not insert the data with Application Intent as only read? If so, that would still insert records to your temp table as its the default feature of the program. I assume non-temp table you've mentioned is a table? Then you should technically do restrict, however there are bugs within .NET which allows CRUD operations through and still insert, update, delete etc a record. OR if it finds any primary primary server (assuming you're making application intent read-only to secondary replica of real time server) then it'll auto connect to that and do the operations.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MaxwellMcGraw-6840 avatar image
0 Votes"
MaxwellMcGraw-6840 answered

Despite the Application Intent as Only read, the data would still be manipulated and can effect records.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.