On Nov 5, 2:52 pm, Technolust <queenskni...@technologist.comwrote:
On Nov 5, 10:18 am, bobh <vulca...@yahoo.comwrote:
Hi All,
I'm looking for help with what the Transact SQL code is for this
Access Update query sql code. I've been doing Access for some time and
all my back-ends have been jet. I'm just starting with SQLServer back-
ends and I'm wanting to change those queries that can be changed to
pass-thru queries using T SQL were I can.
UPDATE tblHospLineFinal INNER JOIN tblCodes ON
tblHospLineFinal.RemarkCode = tblCodes.CodeID SET
tblHospLineFinal.RemarkDescript = tblCodes!CodeDescription;
thanks
bobh.
You can also search for the UPDATE statement with SQL Server
Management Studio help. It will give you information and examples on
how to use the keyword or statement you desire to implement.
I would not do this as I always have the Code Description available by
executing a JOIN. In most cases it's unnecessary to store it twice.
Some would say, "Unwise".
But if in another life I came back as someone less rigorous I would
create a persistent VIEW
eg.
View_1:
SELECT dbo.ExpensesAccounts.CommonName,
dbo.ExpensesTransactions.DebitAccountName
FROM dbo.ExpensesAccounts
INNER JOIN dbo.ExpensesTransactions
ON dbo.ExpensesAccounts.AccountID =
dbo.ExpensesTransactions.DebitAccountID
To Update the DebitAccountName in ExpensesTransactions I would just
run a simple Update
UPDATE View1 SET DebitAccountName = CommonName
In MS-SqlServer this should update the ExpensesTransactions Table.