Microsoft
Software
Hardware
Network
Question : How to convert a SELECT statement into an UPDATE statement using SQL Server 2005?
I am developing an application in ASP and I use SQL Server 2005.
How would you convert the following SELECT statement into an UPDATE statement so that
userid is changed from 'dreed' to 'apagan'
SELECT dbo.tSOXUsrRequest.reqID, reason, tSOXUsrRequest.appname,
dtneeded, tSOXUsrRequest.userid, tSOXUsrRequest.userName,
tSOXUsrRequest.userEml, tSOXUsrRequest.changeReque
st,
tSOXUsrRequest.dtrequested
, tSOXUsrRequest.devID, tSOXUsrRequest.dev
FROM tSOXUsrRequest LEFT OUTER JOIN tSOXSignOFF
ON tSOXUsrRequest.reqID = tSOXSignOFF.reqID WHERE
(tSOXSignOFF.usrSignOff IS NULL)
AND dev = 'bill_lee' and userid = 'dreed'
Answer : How to convert a SELECT statement into an UPDATE statement using SQL Server 2005?
Try this
UPDATE R
SET R.userid = 'apagan'
FROM tSOXUsrRequest R LEFT OUTER JOIN tSOXSignOFF O
ON R.reqID = O.reqID
WHERE (O.usrSignOff IS NULL)
AND R.dev = 'bill_lee' and R.userid = 'dreed'
Random Solutions
Blackberry Enterprise Express on Exchange 2007 Can't resolve name during MAPI Profile Setup
RSH client for windows 2008 r2
Getting the row number of a record
Deleted Files, Who & When, Server 2008, NAS
How to install fonts for my website?
Win 2003 server dns
How to disable use of USB flask drives?
Info@... users Not receiving email
last 3 rows returned in a group - using slq server 8.0.760
Windows player for Twonky media server