RE: Urgent: Regarding use of top

RE: Urgent: Regarding use of top

 

  

I doubt if the below solution will work only on the 20 selected rows.
Isnt it ging to UPDATE all the records where ENAME is same as those in
selected 20 rows?(need not necessarily update ONLY the selected 20 rows. may be more than that)

Thanks,
Yog



-----Original Message-----
From: Daniel Morphett
[mailto:mssqldba-ezmlmshield-x84065205.[Email address protected]
Sent: Thursday, July 29, 2004 11:35 AM
To: LazyDBA Discussion
Subject: RE: Urgent: Regarding use of top


Think what you want is something like:

UPDATE EMP SET SAL=3500
WHERE ENAME in (SELECT TOP 20 ENAME FROM EMP WHERE ENAME LIKE '%s%')


Daniel Morphett
DBA
Brilliant Digital Entertainment
02 9281 9272


-----Original Message-----
From: Biswaranjan Rath
[mailto:mssqldba-ezmlmshield-x16143881.[Email address protected]
Sent: Thursday, July 29, 2004 3:35 PM
To: LazyDBA Discussion
Subject: Urgent: Regarding use of top


I have a SQL query like:

UPDATE EMP SET SAL=3500
WHERE ROWNUM <= 20 AND ENAME LIKE '%s%';

Can anybody help me out by giving suggestion about the equivalent
statement in T-SQL (SQL Server) ?


With best regards

Biswaranjan Rath
Subject Matter Expert
Amdocs DVCI, Pune, India
Phone : +91-20-4048951 Extn.: 302(Office)
+91-20-4062302 (Direct)












------------------------------------------------------------------------
-------------

The information contained in this message is proprietary of Amdocs,

protected from disclosure, and may be privileged.

The information is intended to be conveyed only to the designated
recipient(s)

of the message. If the reader of this message is not the intended
recipient,

you are hereby notified that any dissemination, use, distribution or
copying of

this communication is strictly prohibited and may be unlawful.

If you have received this communication in error, please notify us
immediately

by replying to the message and deleting it from your computer.

Thank you.

---------------------------------------------------------


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]




---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]







Zensar Technologies Ltd. Mail Disclaimer: This e-mail and any files transmitted with it are confidential and the views expressed in the same are not necessarily the views of Zensar Technologies Ltd., and its Directors, Management or Employees. This communication represents the originator's personal views and opinions. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail by error, and that any use, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. You shall be under obligation to keep the contents of this e-mail, strictly confidential and shall not disclose, disseminate or divulge the same to any Person, Company, Firm or Entity. Please ensure you have adequate virus protection before you open or detach any documents from this transmission. Zensar Technologies Ltd. does not accept any liability for virus. If you received this e-mail in error, please immediately notify [Email address protected] The rights to monitor all e-mail communication through our network are reserved with us.



MS Sql Server LazyDBA home page