Solved

Can I edit a SQL table structure while people are using the database?

Posted on 2014-09-26
3
198 Views
Last Modified: 2014-09-26
I have an Access front end and a SQL Express back end.  I sometimes need to add new fields to the tables.  I do this in the evening when there is nobody in the database.  Is it possible to add the new fields while people are using the database?  I know I will have to relink the tables for the changes to be seen but I don't want the users to get any errors once I have made the table changes but not refreshed the links yet.
0
Comment
Question by:egalaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Jerry Miller earned 500 total points
ID: 40346697
I generally don't make structural changes to the tables while users are connected. An ALTER TABLE statement creates a table lock during the duration of the operation. Depending on the size of the table it could take a little time. Read the REMARKS section on this MSDN page:

http://msdn.microsoft.com/en-us/library/ms190273(v=sql.110).aspx

"ALTER TABLE acquires a schema modify (SCH-M) lock on the table to make sure that no other connections reference even the metadata for the table during the change, except online index operations that require a very short SCH-M lock at the end."
0
 
LVL 12

Expert Comment

by:pdebaets
ID: 40346714
On a side note, you can use our free Force Shut Down utility to shut down all copies of your Access application so that back-end or SQL schema changes can be made. then you won't have to wait until evening to do this. More info is at http://peterssoftware.com/fsd.htm
0
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 40346730
That's true, if you have a way to get your users out that is a great alternative. I have one web app where I can send a message and get them all out, but the other one is older and I have to wait until off hours for maintenance.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

624 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