user422481
user422481

Reputation: 49

Insert Command error

I wanna write insert command in sql 2005. I have 10 Columns, some of them can be null. I use this command: Insert Into TableName Values(x,y) since the others can be null, I don't bring them in command. cause, number of null-able columns are different, I can't bring exact null values. but I've got this error:Column name or number of supplied values does not match table definition. what can I do?

Upvotes: 0

Views: 70

Answers (1)

JNK
JNK

Reputation: 65147

1 - Accept some of the past answers to your questions.

2 - Supply which fields you are inserting. In a 5 column table, you can say

INSERT INTO Table (col2, col4)
VALUES (col2value, col4value)

Upvotes: 5

Related Questions