Re: GUID default value

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Vladimir wrote:
> We are developing a complex system, which will run on Oracle, MS SQL
> Server and MS Access databases.

Do you mean Access or do you mean Jet...?

> All the databases are to be replicated.
> We are using a single common database scheme. For each table we have a
> GUID column, which is filled once a new record is inserted. We have
> default values for the GUID column in Oracle DB and MS SQL.
>
> Could you please tell me which is the correct column data type for GUID
> in MS Access and how can we set a default value for the column?
>
> create table PRODUCT_SRC (
> GUID uniqueidentifier not null default newid(),

Jet has a GUID data type. Jet (or is it just Access?) has the ability
to auto-generate GUID values as default. However, I don't think you can
create such a column using SQL DDL alone e.g.

CREATE TABLE PRODUCT_SRC (
....
my_GUID GUID DEFAULT GenGUID NOT NULL

fails because the function which generates GUIDs, GenGUID, seems to be
private to Jet/Access. While this

my_GUID GUID IDENTITY

succeeds, values fail to be auto-generated.

I think you have to use the Access UI or DAO (or possibly the OLE DB
Provider for Jet via ADO) to create the table set the DefaultValue
property to GenGUID. If you did mean Access, then obviously this is no
problem. If, as I suspect, you meant Jet then I'm not entirely sure
this is possible.

.



Relevant Pages

  • Re: GUID default value
    ... > SQL Server and MS Access databases. ... We have default values for the GUID column in Oracle DB ... Autonumber GUID (called a "Replication ID"). ... I don't use Jet DDL since it's not as full-featured as DAO, ...
    (microsoft.public.access.replication)
  • Re: Synchronization between JET 4.0 and SQL Server 7.0/2000 ?
    ... I've heard that it is possible to synchronize between JET 4.0 and SQL ... Server 7.0/2000 databases, but I didn't find much information about ...
    (microsoft.public.access.replication)
  • Synchronization between JET 4.0 and SQL Server 7.0/2000 ?
    ... I've heard that it is possible to synchronize between JET 4.0 and SQL ... Server 7.0/2000 databases, but I didn't find much information about ...
    (microsoft.public.access.replication)
  • Re: is it possible to see SQL Scripts for Tables in Access ?
    ... Rumour has it that Visio will import table descriptions from Jet ... databases and export SQL CREATE TABLE scripts. ...
    (microsoft.public.access.tablesdbdesign)
  • RE: GUID default value
    ... but I am assuming that you are importing a GUID ... > We are developing a complex system, which will run on Oracle, MS SQL ... All the databases are to be replicated. ... > GUID column, which is filled once a new record is inserted. ...
    (microsoft.public.access.tablesdbdesign)