i am trying to use the update function to delete everything after the first white blank space. i have tied this but not working for me so far…
here is my code:
UPDATE MyTable
SET MyField= LEFT(MyField, CHARINDEX('', MyField) - 1)
WHERE CHARINDEX('', MyField) > 0
You have no space in between those single quotes so it is not matching on anything:
See SQL Fiddle with Demo.