Sql Server: logging in stored procedure -


i have stored procedure called c# application.
transaction started , commited/rolledback c# application.

the stored procedure can inserts/updates in various tables, commited or rolledback calling application.

the problem stored procedure insert records logtable, must survive rollback.

what best way of doing ?

i think remember company worked long ago had solved creating stored procedure logging, , stored procedure had exotic statements made work outside transaction, that. said, long time ago remember wrong.

some times ago, i've develop tools logged stored procedure execution in databases table. tools written c# assembly compiled database server , based on differents sql procedures , functions linked c# entry points.

to allow rollback without lost of events allready logged, c# assembly should used full defined connectionstring connect database server (servername\instance server param instead of local).

this perhaps solution used previous company.

meanwhile, there disadvantages:

  • thoses connections qualified "external" , "truthfully" databases parameters should set true allow code execution if not signed
  • this solution not supported on clouded databases (aws rds or azure)
  • a new connection created c# methods

for last reason , customer need, i've rewrite toolbox based on 100% t-sql source code.

i've write response can usefull see: https://stackoverflow.com/a/32988757/1183297


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -