sql - Insert into statement returning an error -
i error on running below code. error message: "column name or number of supplied values not match table definition."
drop table employee create table employee (empid nvarchar(50) , empname nvarchar(50)) insert employee values('13','santhosh','3','karthik')
are there ways make below code work.
drop table employee create table employee (empid nvarchar(50) , empname nvarchar(50)) insert employee values('13','15','17'),('blr','hyd','chn')
you have separate values so:
drop table employee create table employee (empid nvarchar(50) , empname nvarchar(50)) insert employee values('13','santhosh') ,('3','karthik')
each set of values should in parentheses.
update based comments:
reference:
prior sql server 2008, (prior table value constructor)
drop table employee create table employee (empid nvarchar(50) , empname nvarchar(50)) insert employee values ('13','santhosh') insert employee values ('3','karthik')
Comments
Post a Comment