Thanks for the info.
Trust me I have a good reason to want to dupe.
I *am* changing data in *one* field (so the resulting record is not
*identical*) when I do the dupe and the method you gave me allows this.
Thanks.
Imagine a table called "pages" that is used as a back end for a web site.
Imagine you are the admin and you want to create a new page but you don't
want to start from scratch; you want to use another page you created
yesterday and then modify it. So you want to *dupe* a row or record or
whatever you want to call it.
Regarding your assertion that I may end up duping many rows, I would like to
explore this.
What if I have a autonumber Primary Key in my pages table called "ID"?
Can't I just do this:
INSERT table(col2, col3)
SELECT col2, col3
FROM table
WHERE ID=5
note col2 and col3 are not the ID field. I left it out except for in the
where clause.
[quoted text, click to view] "Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:eWMRq8jXEHA.2364@TK2MSFTNGP12.phx.gbl...
> Why would you want to duplicate a row? (The fact that you call it a
record
> gives some hint, at least.)
>
> We have primary keys for a reason.
>
> INSERT table(col1, col2, col3)
> SELECT col1, col2, col3
> FROM table
> WHERE ...
>
> Note that, since you allow duplicate rows, the SELECT portion may return
> more than one row, since you have no way to identify a single row
(remember
> what I said about primary keys a moment ago?). However many rows match
the
> SELECT statement, you will now double them.
>
> --
>
http://www.aspfaq.com/ > (Reverse address to reply.)
>
>
>
>
>
> "Scotter" <spam@spam.com> wrote in message
> news:A6nEc.37113$w3.6637@fe2.texas.rr.com...
> > What syntax would you use to dupe a record?
> > Thanks!
>
>