Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

udf?,isolation ? Expand / Collapse
Author
Message
Posted Friday, April 12, 2013 6:04 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, July 15, 2014 3:08 AM
Points: 68, Visits: 409
i have 2 questions??
1.can we use insert,delete inside user defined function(i tried myself it showing error 'side-effecting operator 'DELETE' within a function.')?
if not why?
2.what is isolation in sql server? where it is used ?
Post #1441655
Posted Friday, April 12, 2013 6:17 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:06 AM
Points: 12,881, Visits: 31,810
gurjer48 (4/12/2013)
i have 2 questions??
1.can we use insert,delete inside user defined function(i tried myself it showing error 'side-effecting operator 'DELETE' within a function.')?
if not why?


No you can't with the slight exception of manipulating a @Table variable. the reason is in SQL server, FUNCTIONS are a streamlined form of a stored procedure, and can only perform READ operations (ie SELECT.
it cannot insert/update/delete to any table or #temp table either. if you need to do that, you have to use a stored proc


2.what is isolation in sql server? where it is used ?

MS can probably describe it better than me:
http://msdn.microsoft.com/en-us/library/ms173763.aspx?ppud=4

basically, the isolation level decides what rules are in place when two people are using the same data at the same time: so if i'm updating some data, lets say your lunch schedule, for 12:00 to 1:00 , do you see the data as it existed how it was before i finish updating(still 12:00, or does your request have to wait you have to wait till i'm done committing the transaction before you can see the data.


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1441661
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse