Upload Autonumber
From: David C (dlchase_at_lifetimeinc.com)
Date: 02/11/05
- Next message: Tibor Karaszi: "Re: How do I copy a file using xp_cmdshell"
- Previous message: Jacco Schalkwijk: "Re: How do I copy a file using xp_cmdshell"
- Next in thread: David Gugick: "Re: Upload Autonumber"
- Reply: David Gugick: "Re: Upload Autonumber"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Tibor Karaszi: "Re: How do I copy a file using xp_cmdshell"
- Previous message: Jacco Schalkwijk: "Re: How do I copy a file using xp_cmdshell"
- Next in thread: David Gugick: "Re: Upload Autonumber"
- Reply: David Gugick: "Re: Upload Autonumber"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|