rickjamesb
MIS
I've been spending the entire day writing sql code, stored procedures, and a pretty big visual basic program so that i could insert typed in user values from vb into rows of a sql table. I could insert rows into other tables, but the table i needed to use would never work. I thought there was a problem with my vb or sql code, and almost gave up.
So i went back to square one, and tried the very basic sql code to insert a row into a table:
And i get this error:
Server: Msg 544, Level 16, State 1, Line 1
Cannot insert explicit value for identity column in table 'Employees' when IDENTITY_INSERT is set to OFF.
Whats the fix to this? EmployeeID is an incremental value, is this the root of the problem? Later on in my project, the EmployeeID is supposed to be a computer generated random number, i can't even get my own input to work! How can i assign it to be random, when its supposed to be incremental!
So i went back to square one, and tried the very basic sql code to insert a row into a table:
Code:
INSERT INTO Employees (EmployeeID, LastName, FirstName)
VALUES (20, 'Jordan', 'Nick')
And i get this error:
Server: Msg 544, Level 16, State 1, Line 1
Cannot insert explicit value for identity column in table 'Employees' when IDENTITY_INSERT is set to OFF.
Whats the fix to this? EmployeeID is an incremental value, is this the root of the problem? Later on in my project, the EmployeeID is supposed to be a computer generated random number, i can't even get my own input to work! How can i assign it to be random, when its supposed to be incremental!