Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mikebird
Aged Yak Warrior
529 Posts |
Posted - 2013-01-22 : 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 destinationwhy these errors? Msg 207, Level 16, State 1, Line 2Invalid column name 'Date'.Msg 207, Level 16, State 1, Line 2Invalid column name 'Qty'.Msg 207, Level 16, State 1, Line 2Invalid column name 'Description'. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
mikebird
Aged Yak Warrior
529 Posts |
Posted - 2013-01-22 : 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 spacesThanks! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|