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)
 putting the script into sql block

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-11-20 : 02:08:59
how to make the below script into sql block and make it as generalize

this is my script like this.

update EMRSchdlPreOrderDetails set EMR_TRANSACTION_ID = SUBSTRING(cast (EMR_TRANSACTION_ID as varchar(20)),3,6)
where PRE_ORDER_DETAILS_ID IN (
select SH.PRE_ORDER_DETAILS_ID
from EMRSchdlPreOrderDetails SH
INNER JOIN EMRPreOrderDetails EPOD on SH.PRE_ORDER_DETAILS_ID=EPOD.PRE_ORDER_DETAILS_ID
INNER JOIN EMRAppointmentDetailsHistory EADH ON EPOD.APPOINTMENT_ID=EADH.APPOINTMENT_ID
--AND EADH.APPOINTMENT_STATUS_ID=2
and YEAR(EADH.CREATED_DATE)=2008
where EMR_TRANSACTION_ID like '80%' and len(EMR_TRANSACTION_ID)=6)


there 80 and 6 needs to get fetched up furthe.please help me n this

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-20 : 03:27:46
<<
there 80 and 6 needs to get fetched up furthe.please help me n this
>>

What do you mean by that?

Madhivanan

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

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-11-20 : 03:31:31
how to put script into sql block
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-20 : 03:37:09
Sorry, your problem is not clear.
I am understanding nothing.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-20 : 03:44:23
quote:
Originally posted by rajasekhar857

how to put script into sql block


We need more informations to help you. As always you give less informations

Madhivanan

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

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-25 : 01:58:35
quote:
Originally posted by rajasekhar857

how to put script into sql block


Any follow up posts?

Madhivanan

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

- Advertisement -