January 6, 2005 at 4:57 am
I have in one table the following:
TABLE A
SessionID, QuizID, QuestionID, AnswerID, Answer
And I want an SP to transfer from this table to Table B with the following structure:
TABLE B
UniqueID (which I get somewhere else),QuestionID, ColumnID (AnswerID), Answer
So there are 3 columns the same, so i want to transfer where the sessionID is X into
Any help would be appreciated
Darryl Wilson
darrylw99@hotmail.com
January 6, 2005 at 5:12 am
INSERT INTO...SELECT... should help
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
January 7, 2005 at 3:50 am
CREATE PROCEDURE usp_copy_session
@SessionID int,
@UniqueID int
AS
INSERT INTO
(UniqueID, QuestionID, ColumnID, Answer)
SELECT @UniqueID, QuestionID, AnswerID, Answer
FROM
WHERE SessionID = @SessionID
Far away is close at hand in the images of elsewhere.
Anon.
January 7, 2005 at 4:25 am
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply