Re: Getting list of recently added IDENTITY items



pb648174 wrote:
As far as DDL, just assume a simple lookup table, Id and Description.

The main reason I use identities is for ease of use. Sometimes I use
natural keys, when they make sense and are a fairly small number of
columns, but other times we have tables that are basically a lookup
table, Id and Description. I suppose I could make the 500 character
description the primary key and only have a single column, but there
QueryString length limitations to deal with, index performance and
other things to worry about with having a large piece of text as a
primary key. I also don't like the idea of having that description data
duplicated when used as a foreign key for all the other tables that
relate to it. If that is just a personal preference and not an actual
problem, I don't know, but as Donald Rumsfeld says, you go to war with
the army you have.

Sure, we could re-architect the solution to make Celko and others treat
us nicely, but that would be hard to sell to the customers - 1 yr delay
to rewrite the software so purists are happy in the discussion forums.
As of now a serializable transaction seems to be the best way to handle
this issue in my mind using my original posted code since we can't also
force our customer to spend 25K to upgrade their SQL servers.

Continue to use IDENTITY. Just declare the other key as well. Does my
solution work for your original problem?

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

.



Relevant Pages

  • Re: SharePoint Services
    ... I'm under the impression that the data tables can be uploaded to a SharePoint location, and that read / edit permissions could be enabled for different users??? ... It was common for customers to have accounts in more than one store / town ... ... However if you do not have share point services setup, nor do you have the expertise and training and resource personnel to run and set up those servers + SharePoint, **if** you users NOW have some type of connection to you network, then then I think the easiest and least amount of effort would be to simply put the backend database on SQL server and and link your front ends to that back end user. ... So, if these people are outside of your corporate network now, then expertise and ability to set up secure connections to allow them to come into your corporate network and pull data from sql server is VERY seriuos issue. ...
    (comp.databases.ms-access)
  • Re: FP/DOS 2.6 -> vfp9 report conversion
    ... There is an ASP.NET application that uses a SQL Server provider. ... about the platform. ... in terms of the installation and system that most customers have. ... So it's the marketplace and the repeat sales concept that I was stressing ...
    (comp.databases.pick)
  • Re: SQL Server Royalty
    ... would the customer, but this "royalty premium"... ... > to work on its database. ... > in house applications using SQL Server to other databases ... >>> customers this 'premium' if customers want to use their ...
    (microsoft.public.sqlserver.clients)
  • Re: Assume SQL Server Rights for apps, any cons?
    ... Since your customer is the sysadmin on his SQL Server box, ... >administrates the underlying SQL Server 2000 database by himself. ... >wants that my software assumes the user rights automatically from the SQL ... >My application offers a GUI to manage customers. ...
    (microsoft.public.dotnet.framework)
  • Re: Data changes made late at night "dissapear"
    ... better way to describe what happened to one of my clerks last night. ... > fact that I know he entered 7 new customers, I can go back through the ... transaction scope. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)