Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Cloning rows with identity fields without wiring in column names

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-16 : 00:29:21
Exasperated writes "How can you take a row in a table with an identity column,
and create a new clone row that differs only in the identity column?

Several approaches come to mind, but I'd like not to have to use select into, since that will cause me to lose transaction logging. Worse, I want a solution that doesn't need changing if a column is added or subtracted from the table.

On the unconstrained side, the operation is rare and it doesn't matter if it is not particularly efficient.

FWIW, the problem comes from a web-site development, where the rate of change is so fast that change-defensive coding is called for. But the reason behind the question, and whether the approach is the right response, is a question that should be discussed separately in one of the forums.

I'm interested in any answers, though the platforms I actually use are SQL Server 7 and later, NT4SP6 and later."
   

- Advertisement -