Pages

Monday, June 14, 2010

SQL 2008

Case
org_type =
CASE org_type
WHEN 'OTHER' THEN 'OTHERS'
WHEN 'M' THEN 'Mountain'
WHEN 'T' THEN 'Touring'
WHEN 'S' THEN 'Other sale items'
ELSE org_type
END


 getting last word has '\'
Select RIGHT(UploadPhysicalPath, CHARINDEX ('\',REVERSE (UploadPhysicalPath))-1),UploadPhysicalPath
  FROM [CLProjects].[dbo].[tbl_Projects]

1 comment: