Hi everyone,
Want I need to do is basically copy a row in my table and insert it into the same table, giving it a different ID.
here is my SQL statement
insert into events (Title, [Description], Location, CreationDate, LastSavedDate, StartDate,
FinishDate, TimeId, LabelID, IsAllDay, UserID, Organization)
select Title, [Description], Location, CreationDate, LastSavedDate, StartDate,
FinishDate, TimeId, LabelID, IsAllDay, UserID, Organization
from Events
where EventID = 31
When I run this is query analyzer, I receive the message one row effected, but nothing is inserted into my table. EventID is my identity field.
After this I wanna get the @@identity of this new rown so I can assign another column a value afterwards.
Any help on why this query isn't working?
Thanks tons for the help,
Cen
Want I need to do is basically copy a row in my table and insert it into the same table, giving it a different ID.
here is my SQL statement
insert into events (Title, [Description], Location, CreationDate, LastSavedDate, StartDate,
FinishDate, TimeId, LabelID, IsAllDay, UserID, Organization)
select Title, [Description], Location, CreationDate, LastSavedDate, StartDate,
FinishDate, TimeId, LabelID, IsAllDay, UserID, Organization
from Events
where EventID = 31
When I run this is query analyzer, I receive the message one row effected, but nothing is inserted into my table. EventID is my identity field.
After this I wanna get the @@identity of this new rown so I can assign another column a value afterwards.
Any help on why this query isn't working?
Thanks tons for the help,
Cen