Upload Autonumber

From: David C (dlchase_at_lifetimeinc.com)
Date: 02/11/05


Date: Fri, 11 Feb 2005 08:48:26 -0600

I am testing an upload from Access 2002 (using replication, but unreplicated
before upload) to SQL Server 2000. The Access database has Autonumber
fields which I expected to upload as Identity. Instead it created insert
trigger similar to one below.

CREATE TRIGGER T_AssessmentDocs_ITrig ON [AssessmentDocs] FOR INSERT AS
SET NOCOUNT ON
DECLARE @randc int, @newc int /* FOR AUTONUMBER-EMULATION CODE */
/* * RANDOM AUTONUMBER EMULATION CODE FOR FIELD 'DocID' */
SELECT @randc = (SELECT convert(int, rand() * power(2, 30)))
SELECT @newc = (SELECT DocID FROM inserted)
UPDATE AssessmentDocs SET DocID = @randc WHERE DocID = @newc

Will this work OK as we plan to use SQL replication also. Thanks.

David



Relevant Pages

  • Re: Access 2000 to SQL Server 2000 Standard
    ... AFAIK you can't replicate to an access database over the internet. ... Looking for a book on SQL Server replication? ... The merge replication stuff in> BOL doesn't address the internet delivery in enought detail for a beginner> like me. ...
    (microsoft.public.sqlserver.replication)
  • Re: Access 2000 to SQL Server 2000 Standard
    ... Presumably they could keep their Access database, ... > AFAIK you can't replicate to an access database over the internet. ... > Looking for a book on SQL Server replication? ...
    (microsoft.public.sqlserver.replication)
  • How to setup replication between access to SQL Server , MSDE instead of Access
    ... We have a computer based application running on trucks and they ... capture the transaction into a Access database we need to collect the ... Can somebody please explain whether Access can replicate to SQL Server ... replication from Access to SQL Server. ...
    (microsoft.public.access.replication)
  • How to setup replication between access to SQL Server , MSDE instead of Access
    ... We have a computer based application running on trucks and they ... capture the transaction into a Access database we need to collect the ... Can somebody please explain whether Access can replicate to SQL Server ... replication from Access to SQL Server. ...
    (microsoft.public.sqlserver.msde)
  • How to setup replication between access to SQL Server , MSDE instead of Access
    ... We have a computer based application running on trucks and they ... capture the transaction into a Access database we need to collect the ... Can somebody please explain whether Access can replicate to SQL Server ... replication from Access to SQL Server. ...
    (microsoft.public.sqlserver.replication)