Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 mssql query needed

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-11-18 : 05:36:36
how to write this in sql server 2005

for curRenewals IN ( SELECT MED_RENEWAL_ID, PRESCRIPTION_XML FROM EMREPrescribeRenewals
where
Convert(Varchar(50),EXTERNAL_RECEIVED_DATETIME, 'MM-DD-YYYY HH:MI:SS AM') >= Convert(Varchar(50),@fromDate, 'MM-DD-YYYY HH:MI:SS AM')
AND
Convert(Varchar(50),EXTERNAL_RECEIVED_DATETIME, 'MM-DD-YYYY HH:MI:SS AM') <= Convert(Varchar(50),@toDate, 'MM-DD-YYYY HH:MI:SS AM')
)
LOOP
UPDATE EMRARCHIEVEEPRESCRIBERENEWALS SET PRESCRIPTION_XML = curRenewals.PRESCRIPTION_XML
WHERE MED_RENEWAL_ID = curRenewals.MED_RENEWAL_ID
END LOOP

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-18 : 05:47:38
You never seem to follow your threads
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=135245
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=135614
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=135651

First respond to those threads, then I will reply to this thread

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -