Closed thegoatherder closed 10 years ago
The following code tagged with the SQL class:
SELECT RIGHT( SUSER_NAME(),LEN( SUSER_NAME())-CHARINDEX('\', SUSER_NAME()))
OUTPUTS:
SELECT RIGHT( SUSER_NAME(),LEN( SUSER_NAME())-CHARINDEX('\'
It appears that the \' escapes the rest of the string. If I add a space after the slash then it renders correctly (but my SQL code is then incorrect!
\'
SELECT RIGHT( SUSER_NAME(),LEN( SUSER_NAME())-CHARINDEX('\ ', SUSER_NAME()))
Thank you, that was a pretty stupid bug :)
The following code tagged with the SQL class:
OUTPUTS:
It appears that the
\'
escapes the rest of the string. If I add a space after the slash then it renders correctly (but my SQL code is then incorrect!