Home > Archive > microsoft.public.sqlserver.server > June 2002 > TRIM data and INSERT INTO





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author TRIM data and INSERT INTO
mike

2002-06-27, 5:25 pm

maybe you could use the string function 'patindex' to tell
you what position the "." is at, subtract one and pass this
integer into the string function 'Left'.

Maybe you declare a string variable, use the sting function
'replace' to remove the file extension(s) if they are the
same then insert the variable into your table.

You might have to load the data into a temp table and then
go from the temp table into the final table.

good luck.

>-----Original Message-----
>Hello Everyone,
>
>I have bunch of file names inserted in my 'T1' table.
>These file names include the dot extension (myfile.txt)
>and the same extension applies to all the file names.
>I need to transfer the same data from 'col_1' to 'col_2'
>in the same table except without the file extension
>(myfile).
>I looked at the LEFT String Functions(T-SQL) but, with
>this string function i need to indicate the number of
>characters from the left i want the function to return to
>me. My file names vary in their number of characters and
>the same number will not work for all the rows.
>
>I appreciate if some one can help me out with this.
>
>Thank you for your time,
>Mitra
>.
>

Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net