快乐的编码!
SELECT SUBSTRING(@YourString,1,LEN(@YourString) - CHARINDEX(' ',REVERSE(@YourString)))
编辑:确保首先修剪@YourString,因为Alex M指出:
SET @YourString = LTRIM(RTRIM(@YourString))