SQL Server and INSERT

Results 1 to 2 of 2

Thread: SQL Server and INSERT

  1. #1
    Ben Roy Guest

    Default SQL Server and INSERT

    This is sort of a follow up to a question I posted earlier about auto-number or identity fields.<BR><BR>Say I have a table like this:<BR><BR>ID<BR>FirstName<BR>LastName<BR><BR>Wh ere ID is an identity field. Then I execute a query like:<BR><BR>INSERT INTO myTable (FirstName, LastName) VALUES (&#039;Ben&#039;, &#039;Roy&#039;)<BR><BR>I get an error saying that I can&#039;t insert NULL into ID. This works fine with an autonumber field in access. What needs to be changed?

  2. #2
    Join Date
    Dec 1969

    Default Table set up wrong...

    ...it&#039;s supposed to work.<BR><BR>For example, http://www.4guysfromrolla.com/webtech/100598-1.shtml<BR><BR>Check out the SQL Server docs to be sure you have the ID field specified correctly in the schema.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts