Re: GUID default value
- From: peregenem@xxxxxxxxxxxx
- Date: 9 Nov 2005 00:30:22 -0800
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.
.
- Follow-Ups:
- Re: GUID default value
- From: Vladimir
- Re: GUID default value
- References:
- GUID default value
- From: Vladimir
- GUID default value
- Prev by Date: Re: designing for pivot tables & charts
- Next by Date: Re: GUID default value
- Previous by thread: RE: GUID default value
- Next by thread: Re: GUID default value
- Index(es):
Relevant Pages
|