Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Updating 2 tables in a view

$
0
0

Hi,

Is it possible to update 2 tables with  single view join?

I have:

ALTER VIEW vw_AuthorizedStationeries
AS
SELECT Stationeries.StationeryID,
	   Stationeries.CreatedOn,
	   StationeryName

FROM dbo.Stationeries

JOIN Northwind.dbo.TestEmployees				as	te
ON
	te.StationeryID = Stationeries.StationeryID

WHERE Authorized = 1
GO

then my update view:

UPDATE vw_AuthorizedStationeries

SET
	CreatedOn = GETDATE()
WHERE
	StationeryID = '11111111-0000-0000-0000-100000000000'
GO

If it is possible, how would I edit my update view function to have 2 tables updated.

Thanks.


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>