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
 General SQL Server Forums
 New to SQL Server Programming
 Steps to remove LTRIM and RTRIM

Author  Topic 

manzoor_mustafa
Starting Member

6 Posts

Posted - 2009-09-07 : 05:40:48
Hi

For DB migration to SQL SERVER 2008, i need to know how to handle the incompactibilty of "LTRIM" function. In SQL SERVER 6.5, LTRIM('') return NULL where as in 2008, EMPTY STRING is returned (from SQL SERVER 2000 onwards, EMPTY STRING is returned).

This had been already documented in "sp_dbcmptlevel" topic:
http://msdn.microsoft.com/en-us/library/aa259649(SQL.80).aspx

Curently, i am manually looking into all objects where LTRIM or RTRIM are used and adding a condition to return NULL(existing business logic checks for NULL value to perform some action at DB level itself).

Is there any work around or a better approach to address this issue(as there more than 800 DB objects - SPs, User Functions to be checked)?


Thanks

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-09-07 : 05:49:54
It shouldn't be too difficult if you script them all out together using Generate Scripts.. and then just search for RTRIM and LTRIM. This way you will find out how large a job it is at least and may make it become a non-issue.
Go to Top of Page
   

- Advertisement -