我有一个包含SampleSentences Sample1,Sample2,Sample3,Sample4的表 和Sample5。
CREATE TABLE [dbo].[WordForm]
(
[WordFormId] VARCHAR (20) NOT NULL,
[WordFormIdentity] INT IDENTITY (1, 1) NOT NULL,
[Sample1] VARCHAR (MAX) NULL,
[Sample2] VARCHAR (MAX) NULL,
[Sample3] VARCHAR (MAX) NULL,
[Sample4] VARCHAR (MAX) NULL,
[Sample5] VARCHAR (MAX) NULL,
PRIMARY KEY CLUSTERED ([WordFormId] ASC))
);
我决定为这些数据添加一个新表:
CREATE TABLE [dbo].[SampleSentence]
(
[SampleSentenceId] INT IDENTITY (1, 1) NOT NULL,
[WordFormId] VARCHAR (20) NOT NULL,
[Text] VARCHAR (MAX) NOT NULL,
CONSTRAINT [PK_SampleSentence]
PRIMARY KEY CLUSTERED ([SampleSentenceId] ASC),
CONSTRAINT [FK_SampleSentenceWordForm]
FOREIGN KEY ([WordFormId]) REFERENCES [dbo].[WordForm] ([WordFormId])
);
有人可以建议我如何从Sample1,Sample2,Sample3,Sample4和Sample5中取出数据并将其插入到新SampleSentence
表中行的文本列中吗?
答案 0 :(得分:1)
你想要这个:
(index,value)