Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Identity_Column

Identity_Column

Scheduled Pinned Locked Moved Database
helpdatabaseregextutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11127370
    wrote on last edited by
    #1

    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...

    C S 2 Replies Last reply
    0
    • U User 11127370

      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...

      C Offline
      C Offline
      Chris Quinn
      wrote on last edited by
      #2

      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. =========================================================

      1 Reply Last reply
      0
      • U User 11127370

        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...

        S Offline
        S Offline
        Swinkaran
        wrote on last edited by
        #3

        When you are inserting a record, The value for Emp_Sal should not contain a comma(,). That is ('Puja',20,000) should be written as ('Puja',20000)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups