May 8, 2004 at 3:04 pm
From my window, I want a user to be able to make a "copy" of a record - with new keys, of couse. What is an example of sql I could use to do this? For example. Let's say a user is maintaining an equipment record and it has lot's of associated data. When they create a new equipment record, maybe a lot of the associated equipment is the same - so rather than have them enter it all again, I will just ask them for new "key" information.
Is there a way to do this?
Thanks
May 8, 2004 at 8:04 pm
Use a simple Insert statement that selects the old record and puts the new values in as variables...
INSERT INTO Foo(fldlist)
SELECT @var1, @var2, fldlist FROM Foo WHERE ....
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply