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)
 update query required

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-12-29 : 04:00:49
Hi i written update query like this but facing problem in it.

UPDATE EMRLabTestLkup SET TEST_CONTAINER=replace(B.TEST_CONTAINER,15,10) FROM EMRLabTestLkup B WHERE

A.TEST_ID=B.TEST_ID AND A.TEST_CONTAINER IS NOT NULL) WHERE TEST_CONTAINER IS NOT NULL

vikky
Yak Posting Veteran

54 Posts

Posted - 2009-12-29 : 04:04:37
what is ur 'A' reference table.

Thanks,
vikky.

Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-12-29 : 04:06:04
EMRLABTESTLKUP
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-12-29 : 04:09:15
UPDATE a
SET TEST_CONTAINER=replace(B.TEST_CONTAINER,15,10)
FROM EMRLabTestLkup a
JOIN EMRLabTestLkup B ON A.TEST_ID=B.TEST_ID
WHERE A.TEST_CONTAINER IS NOT NULL
Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-12-29 : 04:16:05
thank you
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-12-29 : 04:25:16
quote:
Originally posted by rajasekhar857

thank you



welcome
Go to Top of Page
   

- Advertisement -