we are inserting into table system_user for createdby column.
the data that is being inserted is 'DOMAIN\username'
we just need the username and not the domain name
i have used the following code.
CREATE TABLE X (A VARCHAR(20))
Declare @final varchar(20),@len int;
select @final=(system_user);
set @len = patindex('%\%', @final) +1;
select @len;
insert into x values (substring(@final,@len,20))
select * from X
is there an easier way to approach this?
thanks
Noli Timere