Unanswered: Adding new record with values from a view
Good day all,
I am currently re-writing an Access app in SQL Server 2000 so
I am in a VBA mindset finding my way through MS SQL.
I have a table which i'd like to automatically add a new record and a few values from a view in on e swift action. In VBA it would be a simple case of .AddNew, Dlookup value from query, so i'm trying to find the SQL alternative to that. From what I gather this should take care of the task.
INSERT INTO tblMyTable
SELECT Value01, Value02, Value03, Value04
However it is throwing up this error message:
Insert Error: Column name or number of supplied values does not match table definition.
I have named the column names in the view the same as in the destination table however, the view only pulls four fields of the 20 or so that the destination table has, but I was hoping it would create the new record, insert the four values and leave the other values null until it is time to upddate those fields.
Is it possible to create a new record with just four values in SQL, and if so how ?