Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Easy way to duplicate record
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Easy way to duplicate record
Divers
Thread ID:
00468284
Message ID:
00468284
Vues:
55
I want to copy a record from a table to another record of the same table with a new primary key identity column value of course.

The problem is that the table has 162 fields, so listing all fields and building a sql statement with all the right commas and quotation marks is tedious.

I tried:
insert T1 select * from T1 where id=7008
,but it is trying to overwrite the identity then and errs.

If only there was a *-1 specification which meant all fields, but the first.

Any ideas on this?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform