Re: Identity columns with ClientDataSets?

From: Kevin Frevert (what_at_meworry.com)
Date: 07/03/04


Date: Sat, 3 Jul 2004 07:46:50 -0500


"Brian Bushay TeamB" <BBushay@Nmpls.com> wrote in message
news:mr3ce0ddj6qat5qtstm4u51j07ika5bupt@4ax.com...
> This thread does pertain to SQL server.
Are you sure? The first line of the thread is..
"How do you handle Identity columns with SQL Server and ClientDataSets?"

>You can also turn of the
> Identity generation and insert your on value using
> SET IDENTITY_INSERT YourTable ON
> In my opinion you are doing too much work if your database is SQL server.

In my opinion, that is more work. Why would I want to write "SET ...ON/OFF"
every time I want to do inserts just so I could override MSSQL's default
behavior? For us (and many others I've seen), the seed table/stored proc
solution works best for situations where you need to know the next available
key value before you apply the changes to the database (master-detail, user
insistence, ect). To make things even easier (for us) I've wrapped the
stored procedure functionality into a component so now it's..
SomeValue := GetKey.GetNextID('Customers');
Again, that's my opinion and it works best for us. Different situations
require different solutions, so do whatever works best for you and your
customers.

krf

"If your writing a lot of code to do something, your probably doing it
wrong"
- Marco Cantu



Relevant Pages

  • RE: Copying the Contents of a Table from One Database to Another
    ... as long as there are no identity columns. ... MCITP: Database Administrator ... MCTS: SQL Server 2005 ... "Chaplain Doug" wrote: ...
    (microsoft.public.sqlserver.mseq)
  • Re: Table name starting with prefix tbl
    ... I would like to know the opinion on this? ... Table name in database: tbl_mmm_ox ... The above code is perfectly working and inserting record into ... whether we can leave the prefixand suffixand sql server ...
    (comp.databases.ms-sqlserver)
  • Re: identitycolumn as pk
    ... > tables which have identity columns as primarykeys. ... > database to another. ... Should i generate a primarykey ... to make sure SQL Server knows what number to use next. ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL statement need help
    ... To formulate an opinion on a product you need to understand the internals - you don't and because of your extreme ignorance and arrogance you won't; your biggest weakness is you assume you know how it works when frankly you don't - you need to start doing proper research before pushing forward an opinion. ... we all know your opinions stem from over a decade ago where yes the SQL Server product wasn't as good as the rest but now its a solid and extremely popular and well used product within business and the enterprise area. ...
    (microsoft.public.sqlserver.programming)
  • Re: How to handle transactions at Business LogicLayer level
    ... are you using Sql Server? ... You would handle the Transactions at the USP level. ... If you're using a true DAL (and not simply (and errantly in my opinion) ... Data Access Layer using DLINQ which consists of Data Context class ...
    (microsoft.public.dotnet.framework.aspnet)