Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now