Solved

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

Posted on 2014-09-26
3
196 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

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.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

752 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