Solved

Record open by another user

Posted on 2016-10-03
6
59 Views
Last Modified: 2016-10-03
Hello,
Is there any way we can Check whether in sql server the same record is opened by another user on another machine ?


Cheers
0
Comment
Question by:RIAS
  • 3
  • 3
6 Comments
 
LVL 47

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 500 total points
ID: 41826359
Is there any way we can Check whether in sql server the same record is opened by another user on another machine ?
As far as I know you can't. Only way that I can think of is to have a column set to true every time somebody open the record and set it to false when nobody else has the record opened.
Ofc that if the record is locked then a SQL error will be raised when some other process is trying to read the record.
0
 

Author Comment

by:RIAS
ID: 41826363
And what happend if two users are trying to add the same new record at same time ?
Can anything be done about that
0
 
LVL 47

Expert Comment

by:Vitor Montalvão
ID: 41826365
And what happend if two users are trying to add the same new record at same time ?
It depends on your Primary Key definition and the existence of any Unique Index. If you have both or at least one of kind of those indexes then it will raise an error and the second record will be rolled back.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:RIAS
ID: 41826377
So it is all handled by default sql server setting.No settings are required from my side?
0
 
LVL 47

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 41826413
No settings are required from my side?
If you have corrected set the Primary keys and unique keys then the database engine will raise the errors when a duplicate records is being tried to be inserted.
0
 

Author Closing Comment

by:RIAS
ID: 41826424
Very clear and brilliant solution provided as always!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question