rbrown0311
asked on
how do i duplicate a record in a recordset where the primary key with identity set true
I was trying to create a stored procedure listed below
where the primary key is RecordNumber and identity is true
CREATE PROCEDURE DuplicateRegisterHeader(@R ecordNumbe r varchar(10))
AS
Begin
INSERT INTO tRegisterHeader
SELECT * FROM tRegisterHeader
WHERE RecordNumber = 278844
End
this is the returned error msg
Msg 8101, Level 16, State 1, Procedure DuplicateRegisterHeader, Line 4
An explicit value for the identity column in table 'tRegisterHeader' can only be specified when a column list is used and IDENTITY_INSERT is ON.
where the primary key is RecordNumber and identity is true
CREATE PROCEDURE DuplicateRegisterHeader(@R
AS
Begin
INSERT INTO tRegisterHeader
SELECT * FROM tRegisterHeader
WHERE RecordNumber = 278844
End
this is the returned error msg
Msg 8101, Level 16, State 1, Procedure DuplicateRegisterHeader, Line 4
An explicit value for the identity column in table 'tRegisterHeader' can only be specified when a column list is used and IDENTITY_INSERT is ON.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am re-opening this question to allow the author to re-evaluate as a valid solution was offered and they were unable to produce any. Failing that an EE Moderator will review.
I recommend:
2) http:#a39962609
2) http:#a39962609
ASKER
found solution