Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Not Get Update Query to work in SQL Server 2000

Status
Not open for further replies.

DoctorV3774

Programmer
Oct 12, 2004
33
0
0
US
We have a View named vwSubLogCounts_Post2005 which we want to use in SQL Server to update records in a SQL Table named GAIG_History_Producer_Codes

When I run the SQL below in my Access update Query it runs fine. But when I attempt to run in the SQL Server Query Analyzer I get an error incorrect syntax near keyword INNER. How can I fix the SQL statement below so I can get it to run inside SQL server?

*********SQL Statement******************

UPDATE vwSubLogCounts_Post2005 INNER JOIN Combo_GAIG_History_Producer_Codes ON (vwSubLogCounts_Post2005.Producer_Code = Combo_GAIG_History_Producer_Codes.Producer_Code) AND (vwSubLogCounts_Post2005.DateReceived_Year = Combo_GAIG_History_Producer_Codes.GAIG_History_Year) SET Combo_GAIG_History_Producer_Codes.GAIG_Total_Subs = [vwSubLogCounts_Post2005].[Total_Submissions], Combo_GAIG_History_Producer_Codes.GAIG_Total_Bound = [vwSubLogCounts_Post2005].[Total_Bound], Combo_GAIG_History_Producer_Codes.GAIG_Total_Declined = [vwSubLogCounts_Post2005].[Total_Declined];
 
Try setting your SET statements before you do your joins
 
You may get more accurate replies in the SQL Server forum.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top