Question

I'm creating a table "InterviewTemp" , inserting data there, updating a second table with that data and then dropping the "InterviewTemp" table.

there is an example:

CREATE TABLE [entrevistasTemp](
    [id_usuario] [int] NULL,
    [id_entrevista] [int] NULL,
    [comentarios] [varchar](300) NULL
)

INSERT [entrevistasTemp] ([id_usuario], [id_entrevista], [comentarios]) VALUES (12099, 4515, CONVERT(TEXT, N'Riesgo muy alto.  Marun Victoria, '))
INSERT [entrevistasTemp] ([id_usuario], [id_entrevista], [comentarios]) VALUES (15347, 4516, CONVERT(TEXT, N'Riesgo muy alto.  Marun Victoria, '))

UPDATE entrevistas 
    set entrevistas.comentarios = entrevistasTemp.comentarios 
    from entrevistasTemp
WHERE entrevistas.id = entrevistasTemp.id_entrevista

drop table entrevistasTemp

there is a better way to do this?

EDIT: just inserting 4.5k rows

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top