0

I have atlered table by adding Datetime column. This column is not null and also default value from GETDATE().

ALTER TABLE myTable ADD myDateColun DATETIME NOT NULL DEFAULT (GETDATE())

I'm trying to update, I'm unable to update or insert values table

update myTable set myDateColun = GETDATE() where id = someNumber

Its throwing me SQL error

Column name or number of supplied values does not match table definition.

Note: This table has trigger defined on insert and delete scenario for data, which updates synonym table linked to this table in other database.

Any ideas what can be reason for SQL errors in above scenario?

asked Feb 9, 2015 at 4:15

1 Answer 1

3

My guess is that your trigger has a "insert into ... select * from myTable" kind of structure, and now it's broken because there's one more column in the table. Change your trigger so that it lists the columns instead of using *.

answered Feb 9, 2015 at 4:20
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.