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)
 QUERY

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-06-17 : 05:44:51
hi this sql query is correct in oracle


UPDATE EMRConsultantDetails SET DEGREE = LEFT(RTRIM(LTRIM(DEGREE)),10)

UPDATE EMRConsultantDetails SET DEGREE = SUBSTR(RTRIM(LTRIM(DEGREE)),0,10)

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-06-17 : 05:59:42
[code]
UPDATE EMRConsultantDetails SET DEGREE = LEFT(RTRIM(LTRIM(DEGREE)),10)

UPDATE EMRConsultantDetails SET DEGREE = SUBSTRING(RTRIM(LTRIM(DEGREE)),0,10)
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-06-17 : 06:38:37
hi,

the second query which i sent in oracle was equivalent for the sql server one.if not send me the corrected ones
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-06-17 : 06:42:02
hi rajasekhar,
khtan given two queries will work in sql server
Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-06-17 : 06:49:04
hi can the same thing works for oracle
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-06-17 : 07:15:06
in oracle
UPDATE EMRConsultantDetails SET DEGREE = LEFT(RTRIM(LTRIM(DEGREE)),10)
UPDATE EMRConsultantDetails SET DEGREE = SUBSTR(RTRIM(LTRIM(DEGREE)),0,10)
in sqlserver
UPDATE EMRConsultantDetails SET DEGREE = LEFT(RTRIM(LTRIM(DEGREE)),10)
UPDATE EMRConsultantDetails SET DEGREE = SUBSTRING(RTRIM(LTRIM(DEGREE)),0,10)
Go to Top of Page
   

- Advertisement -