Identity_Column
-
Hi, I am getting the following error,while creating identity column in sql ??? This is the code: Create Table Myschema.Employee_Demo ( Emp_ID int constraint pk_con Primary Key Identity(1,1), Emp_Name varchar(55), Emp_Sal decimal(10,2) ) Insert Myschema.Employee_Demo(Emp_Name,Emp_Sal)values('Puja',20,000),('Tira',10,000),('Serrma',15,000),('Airrwari',12,000),('Shyyjina',13,000) ERROR: Msg 110, Level 15, State 1, Line 1 There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. SO, how to solve this error???Please help....... Thanks...
-
Hi, I am getting the following error,while creating identity column in sql ??? This is the code: Create Table Myschema.Employee_Demo ( Emp_ID int constraint pk_con Primary Key Identity(1,1), Emp_Name varchar(55), Emp_Sal decimal(10,2) ) Insert Myschema.Employee_Demo(Emp_Name,Emp_Sal)values('Puja',20,000),('Tira',10,000),('Serrma',15,000),('Airrwari',12,000),('Shyyjina',13,000) ERROR: Msg 110, Level 15, State 1, Line 1 There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. SO, how to solve this error???Please help....... Thanks...
Take the delimiter out of the monetary walues - these are for display only, not to be stored in the database. The SQL parser sees the comma in the figures as a column delimiter
Insert Myschema.Employee_Demo(Emp_Name,Emp_Sal)values('Puja',20000),('Tira',10000),('Serrma',15000),('Airrwari',12000),('Shyyjina',13000)
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
-
Hi, I am getting the following error,while creating identity column in sql ??? This is the code: Create Table Myschema.Employee_Demo ( Emp_ID int constraint pk_con Primary Key Identity(1,1), Emp_Name varchar(55), Emp_Sal decimal(10,2) ) Insert Myschema.Employee_Demo(Emp_Name,Emp_Sal)values('Puja',20,000),('Tira',10,000),('Serrma',15,000),('Airrwari',12,000),('Shyyjina',13,000) ERROR: Msg 110, Level 15, State 1, Line 1 There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. SO, how to solve this error???Please help....... Thanks...