SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


udf?,isolation ?


udf?,isolation ?

Author
Message
super48
super48
SSC-Addicted
SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)

Group: General Forum Members
Points: 475 Visits: 530
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 ?
Lowell
Lowell
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67865 Visits: 40894
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
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search