CodePudding user response:
This is to do the main table list... Don't bother each corresponding to a new table, then the master recordCodePudding user response:
CodePudding user response:
This line can build dynamic SQL to achieve, you can follow this
Declare @ person nvarchar (10)
Select @ person=the person from the test where id=17
Print @ person
Declare @ nSQL nvarchar (200)
The set @ nSQL='create table' + @ person + '(
SNO char (2) not null,
SN char (8) not null,
SEX char (2),
The AGE tinyint,
DEPT char (10)
) '
The exec (@ nSQL)