Sql Express - Multi user write in the same table

Vagelis Roidoulis 6 Reputation points

I m new in sql so i need your help.

i would like to know if it is possible multi user write in the same table.
I want to create a simple program in visual studio with a couple of forms.
At the end and if all the fields are ok i want to write the data in 1 table in an sql express db

Is this possible??
What should I watch out for??

Thanks and regards

PS: Sorry for my English
Do not hesitate to ask me anything you want

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,582 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 41,811 Reputation points

    Yes it is possible. That is what DBs are designed for. When multiple users try to write to the same table the DB will take a lock to ensure that the concurrent writes don't collide.

    You don't need to do anything special as DBs are set up to support this case. The most you want to be careful with is ensuring you don't lock the tables for long such as by using transactions when you don't need them. Since you're new to SQL I doubt you've gotten that far yet.

    But be aware that SQL Express (SE) is a lightweight DB designed for small workloads so the more you try to do with it the more likely you'll run into issues. If you're building a commercial app that needs to support any # of concurrent users then consider upgrading to SQL Server. The nice thing about SE is that it is the same as SQL so you can do your development on SE and then point it to the same database on SQL Server for production use. The only thing that changes is the config file.

    For SE there are limits to how big the DB can get, how many people can connect, etc. Also SE does not respond to network requests by default, IIRC. You also cannot have multiple instances of SE trying to connect to the same MDB file as that will cause problems. SE does run as a service so you'll have to configure the database as an actual database in SE and not just point it to an MDB file if you need to access it from different applications at the same time. Refer to the documentation on SE on how to do all this.

    0 comments No comments

  2. Cris Zhan-MSFT 6,596 Reputation points


    >i would like to know if it is possible multi user write in the same table.

    If the "write" mean insert operation. Yes, that's for sure.

    When you talk about multiple users operating a table at the same time (concurrent operations), I think you have involved SQL Server database transactions and lock knowledge. It is recommended that you check the related documents:

    0 comments No comments