473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

MS access updating to SQL Server Identity Column potential weakness

374 256MB
Hi All,

For nearly a year now I have been migrating over various local access databases over to SQL server back end. Access purely acts as a simple front end to display the data.

I have realised in one of the latest applications I am converting that maybe.. well.. quite possibly I have a bit of a flaw in my logic for updating the sql server back end with any new data from the front end.

When opening up a detailed view of a top level record, which will contain multiple sets of data from other tables that can be edited/added/deleted to I download all of the relevant records related to that top level ID number. This works perfectly fine. I then allow all the edits the user wants to make on the local cached data which is held in local tables in MS Access.

When it comes to the uploading all of this possibly changed data I simply run an update query on the parent record (unless it is deleted) and from there I clear out all the old data on the sql server in the child tables. Once this is done I bulk upload all the local child table data up to the server to hang off the parent ID number.

The above also works fine, however.. there are auto incrementing identity columns. These will be ever increasing as I just wipe out data and upload new. I am worried that of course eventually I may well hit the 20odd million limit of my int field and crap everything out.

After reading:

http://msdn.microsoft.com/en-us/libr...v=sql.90).aspx

I quote: "First, all existing rows matching the OrderID are deleted from the Order Details table. This is more efficient than attempting to determine which order details have been changed, inserted, or edited since the last update."

Microsoft use the exact method as me.. but they do not seem worried. Should I be? Is this as best practice as you can get? I know by trying to send a connection up to the server every time an ounce of data is changed would make things very accurate but also prone to breakage so this bulk upload method seemed to fit the bill fine but the increment values getting larger and larger is getting me worried.
May 19 '12 #1
2 2554
ck9663
2,878 Expert 2GB
I won't question your technique of doing it. If you have another primary key other than the identity column and you're emptying the table, use truncate instead of delete. Truncate re-initialize the identity column.

Good Luck!!!


~~ CK
May 20 '12 #2
munkee
374 256MB
Thank you for the reply CK a TRUNCATE would not quite fit in this situation as I am deleting using a WHERE clause so I only move related data in and out of the table. I do not mind having my method questioned I am always on the look out for improvement as I am probably quite poorly self taught with a lot of Frankenstein methods to get the job done :-p
May 20 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Gunnar Vøyenli | last post by:
Hi (SQL Server 2000) I have an existing table (t) with a column that is NOT an identity column (t.ID), but it has manually inserted "row numbers". I want to make this column become an identity...
2
by: Dave | last post by:
I cannot insert into my appointments table because the primary key and identity column, appt_id, cannot be added. What do I have to change in my SQL statement to add new records into this table? I'm...
5
by: grzes | last post by:
MS SQL Server 2000. My case is: I have the table T with primary key calling __recid int without identity property. This table includes a lot of records (about 1000000). I need to convert __recid's...
3
by: mal_k100 | last post by:
Hi All, 1. Created table in SQL Server 2K with Primary key as int Identity 2. Link to table in MS Access 2K 3. Using form in MSAccess to update the linked table I want SQL server to...
17
by: Trevor Best | last post by:
I don't know if this has been reported before but it appears to be a bug with Access. If I create two tables both with an identity column then create an insert trigger on table1 that inserts a...
2
by: WhiteEagl | last post by:
Hello, I would need some help with this identity column problem in SQLServer. I have a database with two tables. The Parent table has an Identity column. Parent (ParentID IDENTITY, Name)...
1
by: Jerry Camel | last post by:
When I add a new row to a table that has an Identity column, how can I access the value of the identity column for the row that I just added. Do I have to re-fill the dataset through the adapter? ...
2
by: .Net Newbie | last post by:
Hello, I am somewhat new to .Net and currently working on an intranet site using C# going against SQL Server 2k. I am accepting personal information on a single webform and trying to insert the...
3
by: Jason L James | last post by:
Hi all, I recently wrote a vb.net app using oledb to an access database. When I inserted new rows in my datatable the identity column was automatically created. This app used an un-typed...
1
by: Hongyu Sun | last post by:
Hi, All: Please help. I use sql server as back end and Access 2003 as front end (everything is DAO). A table on SQL server has an identity column as the key. We have trouble on adding...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.