| Author |
Topic  |
|
|
mikebird
Aged Yak Warrior
United Kingdom
518 Posts |
Posted - 01/22/2013 : 18:00:29
|
INSERT INTO [dbo.Tesco Delivery] (Date, Qty, Description, Price, Total) SELECT '2010-10-19' ,[Quantity] ,[Product] ,[Price] ,[Total] FROM [dbo].[Tesco del 19 Oct 2010]
the source table has the same fields, apart from the date, which I want to add manually. The select runs fine, returning exactly what I want to see. I cant tell if the error moans about the field names in the select or the insert clause. Line 2 shows the insert clause has the problem? Do the field names really have to match? I tried the select ... into... from... structure, but found this better for adding the date. Do I need to add / remove any paranthesis here?
The question is: How to I add the date manually? There is an auto IDENTITY (1,1) on the first column of the destination
why these errors?
Msg 207, Level 16, State 1, Line 2 Invalid column name 'Date'. Msg 207, Level 16, State 1, Line 2 Invalid column name 'Qty'. Msg 207, Level 16, State 1, Line 2 Invalid column name 'Description'.
|
Edited by - mikebird on 01/22/2013 18:10:22
|
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
|
|
mikebird
Aged Yak Warrior
United Kingdom
518 Posts |
Posted - 01/22/2013 : 18:37:03
|
Impeccable.
I was shocked by those changes. That's all it takes! I thought the only need for squares was to contain names with spaces
Thanks! |
 |
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
|
| |
Topic  |
|
|
|