I use SQL Server 2000 and I have a table with a field rut
of type VARCHAR
(eg: '17045782-8' I need: '17045782') to which I have to remove the check digit and the hyphen. And I do not find it with substring(rut,0,x)
since the length of the rut
until before the script is variable.
How can I do it?