Click here to Skip to main content
15,884,099 members
Home / Discussions / Database
   

Database

 
GeneralRe: User name changed in active directory, SQL Server shows old user name Pin
GuyThiebaut15-Jan-15 9:22
professionalGuyThiebaut15-Jan-15 9:22 
AnswerSUCCESS! Pin
GuyThiebaut15-Jan-15 22:37
professionalGuyThiebaut15-Jan-15 22:37 
QuestionIsolation Level Pin
Member 1137363813-Jan-15 19:07
Member 1137363813-Jan-15 19:07 
AnswerRe: Isolation Level Pin
Eddy Vluggen13-Jan-15 23:44
professionalEddy Vluggen13-Jan-15 23:44 
GeneralRe: Isolation Level Pin
Member 1137363814-Jan-15 0:30
Member 1137363814-Jan-15 0:30 
GeneralRe: Isolation Level Pin
Eddy Vluggen14-Jan-15 2:56
professionalEddy Vluggen14-Jan-15 2:56 
GeneralRe: Isolation Level Pin
Member 1137363814-Jan-15 16:57
Member 1137363814-Jan-15 16:57 
AnswerRe: Isolation Level Pin
Eddy Vluggen15-Jan-15 9:56
professionalEddy Vluggen15-Jan-15 9:56 
Member 11373638 wrote:
in my case one query was doing a select and other doing a update on the same
record.
That's good; I was afraid you'd be doing two insert/update queries, launching them after another, each in a separate thread. For a read, there's multiple ways to handle the situation, but the server will need to be told what to do.

There are isolation levels and query-hints to get the behaviour that you'd want. It'd be a huge coincident if there is always "someone" requesting a record at the moment that the PC is writing it. It is fast in writing a record (and updating the indexes, starting triggers and.. it still takes time)

So, best is to identify why someone is always reading after that update. One cause could be that the piece of code that is updating the record, is also fetching it, immediately, simply to refresh the data on the form. In that case it should block/delay the execution until the update-command returns. Even better; don't do the select at all, but refresh using the values that you already have.

Is it the same PC/terminal that executes the select after the initial update? You could verify quickly (assuming that the problem is repeatable, is it?) using a trace[^].

Member 11373638 wrote:
And good document related to deadlocks in case of Update and Select in a same
table??
I favor MSDN for documentation; besides the isolation levels, you'd also need to see the queries that get executed to determine the current and the desired behaviour. The might already contain or need additional hints[^]. The existing query might already contain a bad idea[^]. And there's a page in the ADO.NET section that may be interesting, even though we are only looking at the database. It's worth the read[^]; it mentions a third possibility - if both statements actually belong together, then they should be wrapped in a transaction. (Could be the case if there's a calculated field in there)

That's a lot of documentation to wade through and probably a lot of code to check. Best idea is to start with the bad idea link Smile | :)
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: Isolation Level Pin
Member 1137363815-Jan-15 17:15
Member 1137363815-Jan-15 17:15 
GeneralRe: Isolation Level Pin
Eddy Vluggen16-Jan-15 7:58
professionalEddy Vluggen16-Jan-15 7:58 
QuestionAudit Tables for Many-Many Relationships Pin
Matt U.13-Jan-15 3:40
Matt U.13-Jan-15 3:40 
AnswerRe: Audit Tables for Many-Many Relationships Pin
Eddy Vluggen13-Jan-15 7:49
professionalEddy Vluggen13-Jan-15 7:49 
GeneralRe: Audit Tables for Many-Many Relationships Pin
Matt U.13-Jan-15 10:00
Matt U.13-Jan-15 10:00 
GeneralRe: Audit Tables for Many-Many Relationships Pin
Eddy Vluggen13-Jan-15 12:49
professionalEddy Vluggen13-Jan-15 12:49 
AnswerRe: Audit Tables for Many-Many Relationships Pin
Mycroft Holmes13-Jan-15 11:42
professionalMycroft Holmes13-Jan-15 11:42 
Questionhelp me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay12-Jan-15 21:16
Nguyen Jay12-Jan-15 21:16 
QuestionRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 5:33
professionalZurdoDev13-Jan-15 5:33 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 5:40
Nguyen Jay13-Jan-15 5:40 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 5:44
professionalZurdoDev13-Jan-15 5:44 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 5:53
Nguyen Jay13-Jan-15 5:53 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 6:00
professionalZurdoDev13-Jan-15 6:00 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 6:03
Nguyen Jay13-Jan-15 6:03 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 6:06
professionalZurdoDev13-Jan-15 6:06 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Richard Deeming13-Jan-15 6:29
mveRichard Deeming13-Jan-15 6:29 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 7:17
Nguyen Jay13-Jan-15 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.