|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Update Query in MS SQL
I have an update query that is using 2 tables from 2 databases on the same server. I am trying to update the status field in 1 table based on having a matching record in the second table. The query works in MS Access, but it does not work in SQL. I added the database name and changed the underscores as well.
UPDATE GFPRINTAUDITApp.dbo.tblPrjInfo INNER JOIN GFPRINTAUDIT.dbo.tblValidatedValues ON GFPRINTAUDITApp.dbo.tblPrjInfo.Code = GFPRINTAUDIT.dbo.tblValidatedValues.Code SET GFPRINTAUDIT.dbo.tblValidatedValues.Active = 1 All help is appreciated. TIA |
|
#2
|
|||
|
|||
|
Code:
UPDATE GFPRINTAUDIT.dbo.tblValidatedValues SET Active = 1 where code in (select code from GFPRINTAUDITApp.dbo.tblPrjInfo) |
|
#3
|
|||
|
|||
|
You da Man! Thanks.
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Update Query in MS SQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|