Home Forums SQL Server 2008 T-SQL (SS2K8) How to insert multiple rows into a table with identity column RE: How to insert multiple rows into a table with identity column

  • Do not include your identity column to you insert statement.

    insert into myTable(identitycol, col1, col2, coln)

    values(1, 'value 1', 'value 2', 'value n') ===>WRONG!

    insert into myTable(col1, col2, coln)

    values('value 1', 'value 2', 'value n') ===>RIGHT!

    "Often speak with code not with word,
    A simple solution for a simple question"