Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Updating Views in sql server

$
0
0

Hi,

I am trying to update a view but the result is 0 row(s) updated

ALTER VIEW vw_AuthorizedStationeries
AS
SELECT StationeryID,
	   CreatedOn,
	   StationeryName

FROM dbo.Stationeries
WHERE Authorized = 1

GO

-----------------Update Views-------------------

UPDATE vw_AuthorizedStationeries

SET
	CreatedOn = GETDATE()
WHERE
	StationeryName = 'StationThree'
GO

What am I doing wrong?

I am trying to update the column 'CreatedOn' with todays date where the row is 'StationThree'.

Is it even possible to what I am trying to do using Views?

Thanks!


Viewing all articles
Browse latest Browse all 8428

Trending Articles



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