|
 |
aspx thread: ID Number Question
Message #1 by "Jonathan Gravois" <wynnewade@t...> on Sun, 11 Nov 2001 18:37:30 -0600
|
|
When I used Access, I used the "autonumber" option to create the Primary
Keys of inserted records. I am now using MSSQL2000 and wonder if I
should continue to allow the db to create the ID number and if so, how.
OR, should I create the number in the asp.net webform? Also, what I want
for the ID is the date & the current time (ie 111101181455). How would I
do this in SQL or ASP.NET?
Thanks,
Jon
Message #2 by Kyle Burns <kburns@c...> on Mon, 12 Nov 2001 09:45:52 -0500
|
|
You should still do this in the database because you want to ensure that the
key is consistant regardless of the application that is using your database.
As far as the date/time thing is concerned, you may want to rethink this
strategy. I've had cases where I thought this would be a good idea and
pushed an app into production after a lot of testing only to discover that
my testing didn't include the "real world" instance of two requests
inserting a record within the same second. This hosed me and I had to go
back and use IDENTITY for the key. I would suggest storing the time and
indexing it if it is important to your query/reporting needs, but don't use
it for your primary key.
=================================
Kyle M. Burns, MCSD, MCT
ECommerce Technology Manager
Centra Credit Union
kburns@c...
-----Original Message-----
From: Jonathan Gravois [mailto:wynnewade@t...]
Sent: Sunday, November 11, 2001 7:38 PM
To: ASP+
Subject: [aspx] ID Number Question
When I used Access, I used the "autonumber" option to create the Primary
Keys of inserted records. I am now using MSSQL2000 and wonder if I
should continue to allow the db to create the ID number and if so, how.
OR, should I create the number in the asp.net webform? Also, what I want
for the ID is the date & the current time (ie 111101181455). How would I
do this in SQL or ASP.NET?
Thanks,
Jon
---
VBug Winter Conference 2001
Open Forum: Dan Appleman will be hosting an open
forum at The .NET Developer's Conference on
29th November 2001. The session will give
developers the chance to discuss and question
Dan on his experience with the .NET environment.
Dan has been programming Visual Basic since the
alpha version 1.0. And with over 10 years
Visual Basic experience is well qualified to
help you on your road to being a .NET Guru.
http://www.vbug.co.uk/redirect.asp?url=39&id=17
---
You are currently subscribed to
aspx as: kburns@c...
$subst('Email.Unsub')
|
|
 |