Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SET TRANSACTION ISOLATION LEVEL within a function

When I want to add the line

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

right after BEGIN clause of my function definition script in SQL SERVER 2008, it says:

Invalid use of a side-effecting operator 'SET TRANSACTION ISOLATION LEVEL' within a function

How can I achive this functionality within a function definition?

like image 811
Farshid Avatar asked Dec 28 '22 02:12

Farshid


1 Answers

You can't.

You need to set this at the start of the batch that calls the function.

like image 142
Oded Avatar answered Jan 07 '23 22:01

Oded