I\'m upsizing an existing MS Access backend to SQL Server 2008 and, because we want to use SQL Server Merge replication, I\'ll have to change all current primary keys (curre
This may be slightly off-topic. However, you do not HAVE to use GUIDs to do merge replication. You can still use your auto-increment integers and allocate different ranges to different database instances. This way rows with identical IDs will not be generated.
Also, there is only one GUID type field in SQL 2008 - uniqueidentifier
Chris is right when saying that (1) you do not need GUIDS for merge replication and (2) there is only one GUID type, but you have to know that:
rowguid
. Of course, if you already have such a GUID/newSequentialId in each table, SQL will make use of it. BUt I do not advise you to 'mix' replication GUIDs with PK GUIDs: you could declare all your primary keys of the GUID type as 'newSequentialIds', but (a) you would then loose the possibility to generate GUID values on the client's side - see infra - and (b) your PKs will then be 'predictable', and this idea makes me feel uncomfortable...Concerning the change from integers to GUIDS, I advise you to write a step-by-step module that will:
Take your time to write this code. You will use it many times before having it properly working. You should make profit of the DAO object, tabledefs, indexes, and so on. Keep in mind that you must allways be able to go back to the starting point, so don't forget the initial backup process.
What about manipulating GUIDs from VBA? There are a few things to know about that:
? myForm.myControl
?????
? myForm.recordset.fields("myFieldName")
{000581EB-9CBF-418C-A2D9-5A7141A686CC}
myFirstRecordset.FindFirst "stringFromGUID(myGuidId) = " & StringFromGUID(mySecondRecordset.Fields("myGuidId").Value)