Hello and thanks in advance for any help!
I was trying to do some table updating within Access, but the tables I'm dealing with are too large. Because of this, I decided to use MS SQL Server Management Studio so that it could be done using SQL code. I was able to formulate my base table, but forgot to add a particular column, so want to update this table now.
Every table referenced below is contained within my database, which is titled KS_SS_2012.05.31_RMS11_RDM
I have a table called Surge_Levels, which has most of my data. I forgot to include a column called MICROZONE. Using SQL Server Management Studio, I was able to add a new column called MICROZONE to the Surge_Levels table. This column is now in there, but is blank.
I have another table within the database called Expacc_Loc, which has the information I need to update the MICROZONE column in the Surge_Levels table. To update the proper fields, I need to join a field in Surge_Levels called LOCNUM and the same field in Expacc_Loc called LOCNUM.
From there, I simply need it to populate MICROZONE in Surge_Levels from what is in Expacc_Loc based on the LOCNUM field.
To do this, I created what I wanted to do in Access, copied the SQL code over, and then did all the modifications I knew were necessary to make SQL run. It appears I must be missing something though, because it isn't working.
This is what I have:
PHP Code:
UPDATE [KS_SS_2012.05.31_RMS11_RDM]..Expacc_Loc INNER JOIN [KS_SS_2012.05.31_RMS11_RDM]..Surge_Levels ON [KS_SS_2012.05.31_RMS11_RDM]..Expacc_Loc.LOCNUM = [KS_SS_2012.05.31_RMS11_RDM]..Surge_Levels.LOCNUM
I am getting an error that says :
Quote:
| Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'INNER'. |
Under the error list, I have:
Invalid Object Name
Quote:
'KS_SS_2012.05.31_RMS11_RDM..Expacc_Loc'.
Incorrect syntax near 'INNER'.
Incorrect syntax near 'ON'. |
I'm a newb to SQL and am sure I'm just overlooking something simple. Thanks again!