tags:

views:

32

answers:

1

Hi, I created dynamic survey. i want to copy the same survey to another survey id.

SurveyTable:

SID SName Created Date

QuestionTable

QID Question SID

AnswerOptionsTable

AID Answer QID 

Now i created one survey for that i added questions and answers. But i want to copy the same survey with another SName so that remaining table also changed accordingly.

Please provide a solution. Thanking you very much in advance. I asked my seniors also.

A: 
INSERT INTO SurveyTable ...
  SELECT ...
  FROM SurveyTable
  WHERE ...

Then capture the new row ID and do similar with the other two tables.

Ignacio Vazquez-Abrams
Here SID, QID, AID are PKs in their tables. Pls send example
sree
I've seen first-hand that not everyone is cut out to be a programmer.
Ignacio Vazquez-Abrams
sorry Order should be like this. New SID -> New QID -> AID. These inter dependent and All should done at one time in SP.
sree