Home > database >  Please eldest brother in her arms, small white to ask questions
Please eldest brother in her arms, small white to ask questions

Time:12-30

CodePudding user response:

Stored procedure is not good, if the table have been built,
Using dynamic SQL, take special field cursor, give to the variable,
Insert into table_ | | @ A (A, B, C)
Select A, B, C from emp
Where A=@ A

CodePudding user response:

Direct execution, if the agency table field structure is the same, can write so directly,

INSERT INTO table B SELECT * FROM A specialty of the WHERE='art'.
INSERT INTO C table SELECT * FROM A specialty of the WHERE='sports';

CodePudding user response:

But I don't know what his specialty is ah, have to take a variable

CodePudding user response:

reference 1/f, the breeze gently up response:
stored procedure is not good, if the table have been built,
Using dynamic SQL, take special field cursor, give to the variable,
Insert into table_ | | @ A (A, B, C)
Select A, B, C from emp
Where A=@ A
didn't understand, can understand some? Or, code and specific? Thank you for the fairy
  • Related