Solved

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

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

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.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 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