I have a table called Node with 4 columns in which the data are populated for all the fields except Lat and Long
TABLE(
ID int not null
Column2 int not null
Column3 int not null
Column4 int not null
LAT float
LONG float
)
I have another table called “test” with 3 columns with date populated
TABLE
(
ID,
LAT
LONG
)
If ID from test matches with Id from node the corresponding lat an long values from test should be inserted into Node.
I tried some thing like this but it give
INSERT INTO tblNode(x,y)
SELECT tpn.Longitude,tpn.Latitude FROM dbo.Node n
JOIN test tpn
ON tpn.NodeID = n.NodeID
Error
Cannot insert the value NULL into column ‘ID’, table
Can Some one help me with this query.
If you were creating new records, you would include the ID
However, looking at your question closely you don’t want to
INSERT. You want toUPDATE