Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easy way to duplicate record
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Easy way to duplicate record
Miscellaneous
Thread ID:
00468284
Message ID:
00468284
Views:
52
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?
Next
Reply
Map
View

Click here to load this message in the networking platform