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
How to Show Up image Use this Script please Help
Integrating MAC OS server and Windows Active Directory
imac osx 10.5 - Does not boot; cannot find harddrive. Getting a folder icon wid a question mark flashin at startup
Printing the details section in group footer
How can I convert a custom control that calls User32 and Shell32 to work on Mono?
how can i find all ILO boards on a network
cisco 2650 memory expansion options
ORA-06502 error when calling stored procedure from Visual Basic 6
Remote Web Workplace Setup
Raid 1 Hard drive failed PowerEdge 1850