M
M
Michael Vasyukov2017-11-26 00:25:04
Microsoft SQL Server Management Studio
Michael Vasyukov, 2017-11-26 00:25:04

How to move a column from one table to another MS SQL?

There are 2 tables: It is
5a19dee8eb2a4484892589.png5a19def20d32e092306204.png
necessary from the 1st table to transfer several columns to the 2nd table.
I'm trying to do this (but it gives an error):

USE WorldSkills;/*Название БД, dbo.Import - первая таблица, dbo.Staff - вторая таблица*/
INSERT INTO dbo.Import SELECT
FirstName,
LastName,
DateOfBrith,
Gender,
Email,
Comments
FROM dbo.Staff;
GO


Error:
Msg 213, Level 16, State 1, Line 3
The column name or number of supplied values ​​does not match the table definition.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2017-11-26
@programmer_developer

insert won't work,
only update where

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question